Skip to content

Commit a9784ea

Browse files
authored
Merge branch 'master' into issue-14689
2 parents 664851f + da1f99f commit a9784ea

File tree

18 files changed

+1882
-741
lines changed

18 files changed

+1882
-741
lines changed

components/gong/actions/retrieve-transcripts-of-calls/retrieve-transcripts-of-calls.mjs

Lines changed: 92 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
name: "Retrieve Transcripts Of Calls",
66
description: "Retrieve transcripts of calls. [See the documentation](https://us-66463.app.gong.io/settings/api/documentation#post-/v2/calls/transcript)",
77
type: "action",
8-
version: "0.0.2",
8+
version: "0.0.3",
99
props: {
1010
app,
1111
fromDateTime: {
@@ -35,6 +35,13 @@ export default {
3535
"callIds",
3636
],
3737
},
38+
returnSimplifiedTranscript: {
39+
type: "boolean",
40+
label: "Return Simplified Transcript",
41+
description: "If true, returns a simplified version of the transcript with normalized speaker IDs and formatted timestamps",
42+
optional: true,
43+
default: false,
44+
},
3845
},
3946
methods: {
4047
retrieveTranscriptsOfCalls(args = {}) {
@@ -43,21 +50,101 @@ export default {
4350
...args,
4451
});
4552
},
53+
54+
millisToTimestamp(millis) {
55+
const totalSeconds = Math.floor(millis / 1000);
56+
const minutes = Math.floor(totalSeconds / 60);
57+
const seconds = totalSeconds % 60;
58+
59+
return `[${minutes.toString().padStart(2, "0")}:${seconds.toString().padStart(2, "0")}]`;
60+
},
61+
62+
simplifyTranscript(originalResponse) {
63+
const simplified = {
64+
...originalResponse,
65+
callTranscripts: originalResponse.callTranscripts.map((callTranscript) => {
66+
// Create a map of unique speaker IDs to simplified names
67+
const speakerMap = new Map();
68+
let speakerCounter = 1;
69+
let currentSpeaker = null;
70+
let currentTopic = null;
71+
let formattedTranscript = "";
72+
73+
// Process each sentence maintaining chronological order
74+
const allSentences = [];
75+
callTranscript.transcript.forEach((segment) => {
76+
segment.sentences.forEach((sentence) => {
77+
allSentences.push({
78+
...sentence,
79+
speakerId: segment.speakerId,
80+
topic: segment.topic,
81+
});
82+
});
83+
});
84+
85+
// Sort by start time
86+
allSentences.sort((a, b) => a.start - b.start);
87+
88+
// Process sentences
89+
allSentences.forEach((sentence) => {
90+
// Map speaker ID to simplified name
91+
if (!speakerMap.has(sentence.speakerId)) {
92+
speakerMap.set(sentence.speakerId, `Speaker ${speakerCounter}`);
93+
speakerCounter++;
94+
}
95+
96+
const speaker = speakerMap.get(sentence.speakerId);
97+
const timestamp = this.millisToTimestamp(sentence.start);
98+
99+
// Handle topic changes
100+
if (sentence.topic !== currentTopic) {
101+
currentTopic = sentence.topic;
102+
if (currentTopic) {
103+
formattedTranscript += `\nTopic: ${currentTopic}\n-------------------\n\n`;
104+
}
105+
}
106+
107+
// Add speaker name only if it changes
108+
if (speaker !== currentSpeaker) {
109+
currentSpeaker = speaker;
110+
formattedTranscript += `\n${speaker}:\n`;
111+
}
112+
113+
// Add timestamp and text
114+
formattedTranscript += `${timestamp} ${sentence.text}\n`;
115+
});
116+
117+
return {
118+
callId: callTranscript.callId,
119+
formattedTranscript: formattedTranscript.trim(),
120+
};
121+
}),
122+
};
123+
124+
return simplified;
125+
},
46126
},
47-
run({ $: step }) {
127+
128+
async run({ $: step }) {
48129
const {
49-
// eslint-disable-next-line no-unused-vars
50-
app,
51130
retrieveTranscriptsOfCalls,
131+
returnSimplifiedTranscript,
132+
simplifyTranscript,
52133
...filter
53134
} = this;
54135

55-
return retrieveTranscriptsOfCalls({
136+
const response = await retrieveTranscriptsOfCalls({
56137
step,
57138
data: {
58139
filter,
59140
},
60141
summary: (response) => `Successfully retrieved transcripts of calls with request ID \`${response.requestId}\`.`,
61142
});
143+
144+
if (returnSimplifiedTranscript) {
145+
return simplifyTranscript(response);
146+
}
147+
148+
return response;
62149
},
63150
};

components/gong/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/gong",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"description": "Pipedream Gong Components",
55
"main": "gong.app.mjs",
66
"keywords": [

docs-v2/pages/troubleshooting.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@ https://pipedream.com/sources/dc_abc123
8282

8383
Your source's ID is the value that starts with `dc_`. In this example: `dc_abc123`.
8484

85+
## Why is my trigger paused?
86+
87+
Pipedream automatically disables sources with a 100% error rate in the past 5 days for accounts on the Free plan.
88+
89+
To troubleshoot, you can look at the errors in the [source](/sources/) logs, and may need to reconnect your account and re-enable the source for it to run again. If the issue persists, please reach out in [the community](https://pipedream.com/support).
90+
8591
## Warnings
8692

8793
Pipedream displays warnings below steps in certain conditions. These warnings do not stop the execution of your workflow, but can signal an issue you should be aware of.

packages/sdk/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
<!-- markdownlint-disable MD024 -->
22
# Changelog
33

4+
## [1.0.6] - 2024-11-20
5+
6+
### Changed
7+
8+
- Use client Connect tokens to make api calls directly from the client.
9+
- Deprecated the `environments` property on `createFrontendClient` since it is now
10+
stored in the token
11+
412
## [1.0.5] - 2024-11-18
513

614
### Changed

packages/sdk/package-lock.json

Lines changed: 70 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/sdk/package.json

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,27 @@
11
{
22
"name": "@pipedream/sdk",
3-
"version": "1.0.5",
3+
"version": "1.0.6",
44
"description": "Pipedream SDK",
5-
"main": "dist/server/index.js",
6-
"module": "dist/server/index.js",
7-
"types": "dist/server/index.d.ts",
8-
"browser": "./dist/browser/index.js",
5+
"main": "dist/server/server/index.js",
6+
"module": "dist/server/server/index.js",
7+
"types": "dist/server/server/index.d.ts",
8+
"browser": "./dist/browser/browser/index.js",
99
"exports": {
1010
".": {
11-
"browser": "./dist/browser/index.js",
12-
"import": "./dist/server/index.js",
13-
"require": "./dist/server/index.js",
14-
"default": "./dist/server/index.js"
11+
"browser": "./dist/browser/browser/index.js",
12+
"import": "./dist/server/server/index.js",
13+
"require": "./dist/server/server/index.js",
14+
"default": "./dist/server/server/index.js"
15+
},
16+
"./server": {
17+
"import": "./dist/server/server/index.js",
18+
"require": "./dist/server/server/index.js",
19+
"types": "./dist/server/server/index.d.ts"
20+
},
21+
"./browser": {
22+
"import": "./dist/browser/browser/index.js",
23+
"require": "./dist/browser/browser/index.js",
24+
"types": "./dist/browser/browser/index.d.ts"
1525
}
1626
},
1727
"engines": {
@@ -25,28 +35,35 @@
2535
"access": "public"
2636
},
2737
"scripts": {
38+
"lint": "eslint --fix --ext .ts src",
2839
"prepublish": "rm -rf dist && npm run build",
2940
"build": "npm run build:node && npm run build:browser",
3041
"build:node": "tsc -p tsconfig.node.json",
3142
"build:browser": "tsc -p tsconfig.browser.json",
3243
"test": "jest",
33-
"watch": "nodemon --watch src --ext ts --exec 'npm run build'"
44+
"watch": "nodemon --watch src --ext ts --exec 'npm run build'",
45+
"cli": "node dist/server/server/cli.js"
3446
},
3547
"files": [
3648
"dist"
3749
],
3850
"devDependencies": {
3951
"@types/fetch-mock": "^7.3.8",
4052
"@types/jest": "^29.5.13",
41-
"@types/node": "^20.14.9",
53+
"@types/node": "^20.17.6",
54+
"@types/rails__actioncable": "^6.1.11",
4255
"@types/simple-oauth2": "^5.0.7",
56+
"@types/ws": "^8.5.13",
4357
"jest": "^29.7.0",
4458
"jest-fetch-mock": "^3.0.3",
4559
"nodemon": "^3.1.7",
4660
"ts-jest": "^29.2.5",
4761
"typescript": "^5.5.2"
4862
},
4963
"dependencies": {
50-
"simple-oauth2": "^5.1.0"
64+
"@rails/actioncable": "^8.0.0",
65+
"commander": "^12.1.0",
66+
"simple-oauth2": "^5.1.0",
67+
"ws": "^8.18.0"
5168
}
5269
}

0 commit comments

Comments
 (0)