-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #107 from freshworks/revert_stable_build
Revert stable build
- Loading branch information
Showing
9 changed files
with
78 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@freshworks-jaya/freshchat-api", | ||
"version": "0.7.33-beta-09", | ||
"version": "0.7.34", | ||
"description": "Provides simple interface for accessing Freshchat's public APIs", | ||
"repository": "[email protected]:freshdesk/jaya-lib.git", | ||
"main": "lib/index.js", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@freshworks-jaya/marketplace-models", | ||
"version": "0.1.26", | ||
"version": "0.1.27", | ||
"description": "Provides type definitions for models in marketplace product events", | ||
"repository": "[email protected]:freshdesk/jaya-lib.git", | ||
"main": "lib/index.js", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@freshworks-jaya/rule-engine", | ||
"version": "0.17.25-beta-03", | ||
"version": "0.17.26", | ||
"description": "Provides methods to process rules in product events in marketplace app", | ||
"repository": "[email protected]:freshdesk/jaya-lib.git", | ||
"main": "lib/index.js", | ||
|
@@ -44,9 +44,9 @@ | |
"typescript": "^4.3.2" | ||
}, | ||
"dependencies": { | ||
"@freshworks-jaya/freshchat-api": "0.7.33-beta-09", | ||
"@freshworks-jaya/freshchat-api": "0.7.34", | ||
"@freshworks-jaya/kairos-api": "^0.1.5", | ||
"@freshworks-jaya/marketplace-models": "0.1.26", | ||
"@freshworks-jaya/marketplace-models": "0.1.27", | ||
"@freshworks-jaya/utilities": "^1.0.0", | ||
"@google-cloud/logging": "^9.3.1", | ||
"axios": "^0.21.4", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,7 +62,7 @@ export default async ( | |
accountId: appId, | ||
from: { | ||
email: '[email protected]', | ||
name: 'Freshchat Automations', | ||
name: 'Automated response', | ||
}, | ||
html: emailParams.body, | ||
subject: emailParams.subject, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,7 +59,7 @@ export default async ( | |
accountId: appId, | ||
from: { | ||
email: '[email protected]', | ||
name: 'Freshchat Automations', | ||
name: 'Automated response', | ||
}, | ||
html: conversationHtml, | ||
subject: emailSubject, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
...ine/src/recommended/dynamic-placeholders/transcript-paytm-conv-since-last-resolve-html.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import { ProductEventPayload } from '@freshworks-jaya/marketplace-models'; | ||
import Freshchat from '@freshworks-jaya/freshchat-api'; | ||
import { Integrations, RuleEngineOptions } from '../../models/rule-engine'; | ||
import { Utils } from '../../Utils'; | ||
import { ErrorCodes, ErrorTypes } from '../../models/error-codes'; | ||
import { LogSeverity } from '../../services/GoogleCloudLogging'; | ||
import Constants from '../Constants'; | ||
|
||
export default ( | ||
productEventPayload: ProductEventPayload, | ||
integrations: Integrations, | ||
options: RuleEngineOptions, | ||
ruleAlias: string, | ||
): Promise<string> => { | ||
const freshchatApiUrl = integrations.freshchatv2.url; | ||
const freshchatApiToken = integrations.freshchatv2.token; | ||
const freshchat = new Freshchat(freshchatApiUrl, freshchatApiToken, ruleAlias); | ||
const modelProperties = productEventPayload.data.conversation || productEventPayload.data.message; | ||
|
||
return freshchat | ||
.getConversationTranscript( | ||
`https://${productEventPayload.domain}`, | ||
modelProperties.app_id, | ||
modelProperties.conversation_id, | ||
{ | ||
isFetchUntilLastResolve: true, | ||
isIncludeFreshchatLink: false, | ||
messagesLimit: options.isUseStaticIP | ||
? Constants.MAX_MESSAGES_TRANSCRIPT_STATIC_IP | ||
: Constants.MAX_MESSAGES_TRANSCRIPT, | ||
output: 'paytm_html', | ||
timezoneOffset: integrations.timezoneOffset, | ||
}, | ||
{ | ||
isExcludePrivate: true, | ||
isExcludeSystem: true, | ||
}, | ||
) | ||
.then((transcript) => Promise.resolve(transcript)) | ||
.catch((err) => { | ||
Utils.log( | ||
productEventPayload, | ||
integrations, | ||
ErrorCodes.FreshchatPlaceholder, | ||
{ | ||
error: { | ||
err, | ||
payload: { | ||
freshchatApiToken, | ||
options: { | ||
messagesLimit: options.isUseStaticIP | ||
? Constants.MAX_MESSAGES_TRANSCRIPT_STATIC_IP | ||
: Constants.MAX_MESSAGES_TRANSCRIPT, | ||
timezoneOffset: integrations.timezoneOffset, | ||
}, | ||
}, | ||
}, | ||
errorType: ErrorTypes.TranscriptLastResolveHtml, | ||
}, | ||
LogSeverity.ERROR, | ||
); | ||
return Promise.reject(); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters