diff --git a/packages/marketplace-models/package.json b/packages/marketplace-models/package.json index fc7776f5..06c1a7ce 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.39", + "version": "0.1.38", "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/marketplace-models/src/types/PayloadData.ts b/packages/marketplace-models/src/types/PayloadData.ts index 8aad4ede..08a4cca7 100644 --- a/packages/marketplace-models/src/types/PayloadData.ts +++ b/packages/marketplace-models/src/types/PayloadData.ts @@ -59,11 +59,6 @@ export enum ResponseDueType { ResponseDue = 'RESPONSE_DUE', } -export enum ResolutionDueType { - NO_RESOLUTION_DUE = 'NO_RESOLUTION_DUE', - RESOLUTION_DUE = 'RESOLUTION_DUE', -} - export enum ActorSubEntity { AgentGroupMapping = 'agent_group_mapping', AssignmentRule = 'assignment_rule', @@ -215,7 +210,6 @@ export interface ModelProperties { // eslint-disable-next-line @typescript-eslint/no-explicit-any properties: any; reopened_time: string | null; - resolution_due_type: ResolutionDueType; resolved_time: string | null; response_due_type: ResponseDueType; sla_policy_name?: string | null; diff --git a/packages/rule-engine/package.json b/packages/rule-engine/package.json index 7ea7e8de..c85f59d8 100644 --- a/packages/rule-engine/package.json +++ b/packages/rule-engine/package.json @@ -1,6 +1,6 @@ { "name": "@freshworks-jaya/rule-engine", - "version": "0.18.6-beta-32", + "version": "0.18.6-beta-31", "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.36-beta-2", "@freshworks-jaya/kairos-api": "^0.1.5", - "@freshworks-jaya/marketplace-models": "0.1.39", + "@freshworks-jaya/marketplace-models": "0.1.38", "@freshworks-jaya/utilities": "^1.0.0", "@google-cloud/logging": "^9.3.1", "axios": "^0.21.4", diff --git a/packages/rule-engine/src/models/rule.ts b/packages/rule-engine/src/models/rule.ts index e0e6d247..d0642250 100644 --- a/packages/rule-engine/src/models/rule.ts +++ b/packages/rule-engine/src/models/rule.ts @@ -32,7 +32,6 @@ export enum TriggerActionType { FirstSlaBreach = 'FIRST_SLA_BREACH', MessageCreate = 'MESSAGE_CREATE', NextSlaBreach = 'NEXT_SLA_BREACH', - ResolutionSlaBreach = 'RESOLUTION_SLA_BREACH', PrivateNoteCreate = 'PRIVATE_NOTE_CREATE', UpdateConversationProperty = 'UPDATE_CONVERSATION_PROPERTY', } diff --git a/packages/rule-engine/src/recommended/index.ts b/packages/rule-engine/src/recommended/index.ts index 5c4a1c11..abd711c2 100644 --- a/packages/rule-engine/src/recommended/index.ts +++ b/packages/rule-engine/src/recommended/index.ts @@ -35,7 +35,6 @@ import triggerActionMessageCreate from './trigger-actions/message-create'; import triggerActionPrivateNoteCreate from './trigger-actions/private-note-create'; import triggerActionFirstSLABreach from './trigger-actions/first-sla-breach'; import triggerActionNextSLABreach from './trigger-actions/next-sla-breach'; -import triggerActionResolutionSLABreach from './trigger-actions/resolution-sla-breach'; import triggerActionCallEnded from './trigger-actions/call-ended'; import triggerActionUpdateConversationProperty from './trigger-actions/update-conversation-property'; @@ -201,7 +200,6 @@ const recommendedPlugins: RulePlugin[] = [ [TriggerActionType.PrivateNoteCreate]: triggerActionPrivateNoteCreate, [TriggerActionType.FirstSlaBreach]: triggerActionFirstSLABreach, [TriggerActionType.NextSlaBreach]: triggerActionNextSLABreach, - [TriggerActionType.ResolutionSlaBreach]: triggerActionResolutionSLABreach, [TriggerActionType.CallEnded]: triggerActionCallEnded, [TriggerActionType.UpdateConversationProperty]: triggerActionUpdateConversationProperty, }, diff --git a/packages/rule-engine/src/recommended/trigger-actions/resolution-sla-breach.ts b/packages/rule-engine/src/recommended/trigger-actions/resolution-sla-breach.ts deleted file mode 100644 index 90900efd..00000000 --- a/packages/rule-engine/src/recommended/trigger-actions/resolution-sla-breach.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Event, ProductEventData, MessageType } from '@freshworks-jaya/marketplace-models'; -import { TriggerAction } from '../../models/rule'; - -export default (productEvent: Event, productEventData: ProductEventData, triggerAction: TriggerAction): boolean => { - return ( - productEvent === Event.ConversationUpdate && - !!productEventData.changes.model_changes && - !!productEventData.changes.model_changes?.sla_breach && - !!productEventData.changes.model_changes?.sla_breach[1] && - productEventData.conversation.resolution_due_type === 'RESOLUTION_DUE' - ); -};