From f480dfac2886a9bb1bee4c8675bfe4dd2843f8b5 Mon Sep 17 00:00:00 2001 From: srivatsan7 Date: Wed, 11 Oct 2023 22:58:58 +0530 Subject: [PATCH 1/5] loop issue commit --- packages/marketplace-models/src/types/PayloadData.ts | 1 + .../recommended/trigger-actions/update-conversation-property.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/marketplace-models/src/types/PayloadData.ts b/packages/marketplace-models/src/types/PayloadData.ts index de38858f..aea4a2dd 100644 --- a/packages/marketplace-models/src/types/PayloadData.ts +++ b/packages/marketplace-models/src/types/PayloadData.ts @@ -141,6 +141,7 @@ export interface ReplyPart { } export interface Actor { + actor_source: string; avatar: { url: string; }; diff --git a/packages/rule-engine/src/recommended/trigger-actions/update-conversation-property.ts b/packages/rule-engine/src/recommended/trigger-actions/update-conversation-property.ts index 963137e6..fa98d326 100644 --- a/packages/rule-engine/src/recommended/trigger-actions/update-conversation-property.ts +++ b/packages/rule-engine/src/recommended/trigger-actions/update-conversation-property.ts @@ -7,6 +7,7 @@ export default (productEvent: Event, productEventData: ProductEventData, trigger return ( productEvent === Event.ConversationUpdate && + productEventData.actor.actor_source != 'API' && !!productEventData.changes.model_changes && (!!productEventData.changes.model_changes.assigned_agent_id || !!productEventData.changes.model_changes.assigned_group_id || From 9d7a8d30d87d93c6bb9e21bfc767f7c554cb7b83 Mon Sep 17 00:00:00 2001 From: srivatsan7 Date: Fri, 13 Oct 2023 23:10:37 +0530 Subject: [PATCH 2/5] Update update-conversation-property.ts --- .../recommended/trigger-actions/update-conversation-property.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/rule-engine/src/recommended/trigger-actions/update-conversation-property.ts b/packages/rule-engine/src/recommended/trigger-actions/update-conversation-property.ts index fa98d326..e0732a8c 100644 --- a/packages/rule-engine/src/recommended/trigger-actions/update-conversation-property.ts +++ b/packages/rule-engine/src/recommended/trigger-actions/update-conversation-property.ts @@ -7,6 +7,7 @@ export default (productEvent: Event, productEventData: ProductEventData, trigger return ( productEvent === Event.ConversationUpdate && + productEventData.actor.actor_source != null && productEventData.actor.actor_source != 'API' && !!productEventData.changes.model_changes && (!!productEventData.changes.model_changes.assigned_agent_id || From 26f4c21c33187ec031253d53a80b17bbbf019c1d Mon Sep 17 00:00:00 2001 From: srivatsan7 Date: Mon, 16 Oct 2023 14:56:37 +0530 Subject: [PATCH 3/5] add changes --- packages/marketplace-models/package.json | 2 +- packages/rule-engine/package.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/marketplace-models/package.json b/packages/marketplace-models/package.json index c703f9e2..ca2721c7 100644 --- a/packages/marketplace-models/package.json +++ b/packages/marketplace-models/package.json @@ -1,6 +1,6 @@ { "name": "@freshworks-jaya/marketplace-models", - "version": "0.1.25", + "version": "0.1.26", "description": "Provides type definitions for models in marketplace product events", "repository": "git@github.com:freshdesk/jaya-lib.git", "main": "lib/index.js", diff --git a/packages/rule-engine/package.json b/packages/rule-engine/package.json index 6f51ee7d..6af34455 100644 --- a/packages/rule-engine/package.json +++ b/packages/rule-engine/package.json @@ -1,6 +1,6 @@ { "name": "@freshworks-jaya/rule-engine", - "version": "0.17.25-beta-02", + "version": "0.17.25-beta-03", "description": "Provides methods to process rules in product events in marketplace app", "repository": "git@github.com:freshdesk/jaya-lib.git", "main": "lib/index.js", @@ -46,7 +46,7 @@ "dependencies": { "@freshworks-jaya/freshchat-api": "0.7.33-beta-09", "@freshworks-jaya/kairos-api": "^0.1.5", - "@freshworks-jaya/marketplace-models": "0.1.25", + "@freshworks-jaya/marketplace-models": "0.1.26", "@freshworks-jaya/utilities": "^1.0.0", "@google-cloud/logging": "^9.3.1", "axios": "^0.21.4", From 029c60d15637f5b33afca951640d57368bc21de0 Mon Sep 17 00:00:00 2001 From: srivatsan7 Date: Mon, 16 Oct 2023 15:12:35 +0530 Subject: [PATCH 4/5] Update update-conversation-property.ts --- .../trigger-actions/update-conversation-property.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/rule-engine/src/recommended/trigger-actions/update-conversation-property.ts b/packages/rule-engine/src/recommended/trigger-actions/update-conversation-property.ts index e0732a8c..04f82385 100644 --- a/packages/rule-engine/src/recommended/trigger-actions/update-conversation-property.ts +++ b/packages/rule-engine/src/recommended/trigger-actions/update-conversation-property.ts @@ -7,8 +7,8 @@ export default (productEvent: Event, productEventData: ProductEventData, trigger return ( productEvent === Event.ConversationUpdate && - productEventData.actor.actor_source != null && - productEventData.actor.actor_source != 'API' && + productEventData.actor?.actor_source != null && + productEventData.actor?.actor_source != 'API' && !!productEventData.changes.model_changes && (!!productEventData.changes.model_changes.assigned_agent_id || !!productEventData.changes.model_changes.assigned_group_id || From b63f820cfccb7e845f2c635cf0484b2b6259787a Mon Sep 17 00:00:00 2001 From: srivatsan7 Date: Mon, 16 Oct 2023 15:15:02 +0530 Subject: [PATCH 5/5] Update PayloadData.ts --- packages/marketplace-models/src/types/PayloadData.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/marketplace-models/src/types/PayloadData.ts b/packages/marketplace-models/src/types/PayloadData.ts index e6770549..63c942c2 100644 --- a/packages/marketplace-models/src/types/PayloadData.ts +++ b/packages/marketplace-models/src/types/PayloadData.ts @@ -146,7 +146,7 @@ export interface ReplyPart { } export interface Actor { - actor_source: string; + actor_source?: string; avatar: { url: string; };