Skip to content

Gong - Add contentSelector to extensive call data #18090

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
7971dad
fix: pagination prop and params struct
Jun 3, 2025
0eaba8e
fix: no need for paginate here
Jun 3, 2025
330430e
chore: update version
Jun 3, 2025
3d6802e
Merge branch 'master' into master
jocarino Jun 3, 2025
379e23d
chore: cleanup
Jun 4, 2025
6f320c1
chore: update package
joaocoform Jun 17, 2025
39e9dfe
Merge remote-tracking branch 'upstream/master'
jocarino Jun 27, 2025
a051253
feat: allow raw response
jocarino Jun 30, 2025
77b2e13
chore: bump package
jocarino Jun 30, 2025
05d29c5
fix: buffer response instead
jocarino Jul 1, 2025
0303c22
Update components/google_drive/actions/download-file/download-file.mjs
jocarino Jul 1, 2025
a9a743d
Merge remote-tracking branch 'upstream/master'
jocarino Jul 3, 2025
7a7cb53
Merge branches 'master' and 'master' of github-personal:jocarino/pipe…
jocarino Jul 3, 2025
8bedd60
versions
michelle0927 Jul 3, 2025
5e2888c
pnpm-lock.yaml
michelle0927 Jul 3, 2025
033fb6d
pnpm-lock.yaml
michelle0927 Jul 3, 2025
8412b56
Merge remote-tracking branch 'upstream/master'
michelle0927 Jul 3, 2025
3fa1060
pnpm-lock.yaml
michelle0927 Jul 3, 2025
e08c027
Merge remote-tracking branch 'upstream/master'
jocarino Aug 15, 2025
63c13d8
feat: add content selector
jocarino Aug 18, 2025
5cd0755
Merge branch 'master' of github-personal:jocarino/pipedream
jocarino Aug 18, 2025
be9cca9
Merge remote-tracking branch 'upstream/master'
jocarino Aug 18, 2025
066dae1
chore: bump package
jocarino Aug 18, 2025
700c9eb
Merge branch 'master' into master
luancazarine Aug 18, 2025
ef77de5
fix: comments
jocarino Aug 19, 2025
8581a8f
Merge branch 'master' of github-personal:jocarino/pipedream
jocarino Aug 19, 2025
78f78e2
Merge remote-tracking branch 'upstream/master'
jocarino Aug 19, 2025
ec8d317
chore: bump versions
jocarino Aug 19, 2025
aa2aa24
chore: fix versions
jocarino Aug 19, 2025
5de5e9e
fixes: QA fixes
jocarino Aug 21, 2025
d673426
Merge remote-tracking branch 'upstream/master'
jocarino Aug 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/gong/actions/add-new-call/add-new-call.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default {
name: "Add New Call",
description: "Add a new call. [See the documentation](https://us-66463.app.gong.io/settings/api/documentation#post-/v2/calls)",
type: "action",
version: "0.0.2",
version: "0.0.3",
props: {
app,
clientUniqueId: {
Expand Down
117 changes: 115 additions & 2 deletions components/gong/actions/get-extensive-data/get-extensive-data.mjs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import app from "../../gong.app.mjs";
import constants from "../../common/constants.mjs";
import { ConfigurationError } from "@pipedream/platform";
import utils from "../../common/utils.mjs";

export default {
key: "gong-get-extensive-data",
name: "Get Extensive Data",
description: "Lists detailed call data. [See the documentation](https://us-66463.app.gong.io/settings/api/documentation#post-/v2/calls/extensive)",
version: "0.0.1",
description: "Lists detailed call data. [See the documentation](https://gong.app.gong.io/settings/api/documentation#post-/v2/calls/extensive)",
version: "0.0.3",
type: "action",
props: {
app,
Expand Down Expand Up @@ -54,6 +55,75 @@ export default {
default: constants.DEFAULT_MAX,
optional: true,
},
context: {
type: "string",
label: "Context",
description: "If 'Basic', add links to external systems (context objects) such as CRM, Telephony System, Case Management. If 'Extended' include also data (context fields) for these links.",
options: [
"None",
"Basic",
"Extended",
],
default: "None",
optional: true,
},
contextTiming: {
type: "string[]",
label: "Context Timing",
description: "Allowed: Now, TimeOfCall. Timing for the context data. The field is optional and can contain either 'Now' or 'TimeOfCall' or both. The default value is ['Now']. Can be provided only when the context field is set to 'Extended'",
optional: true,
},
includeParties: {
type: "boolean",
label: "Include Parties",
description: "Whether to include parties in the response",
default: false,
optional: true,
},
exposedFieldsContent: {
type: "object",
label: "Exposed Fields Content",
description: "Specify which fields to include in the response for the content. Example object: {'structure': false, 'topics': false, 'trackers': false, 'trackerOccurrences': false, 'pointsOfInterest': false, 'brief': true, 'outline': true, 'highlights': true, 'callOutcome': true, 'keyPoints': true}",
default: {
"structure": "false",
"topics": "false",
"trackers": "false",
"trackerOccurrences": "false",
"pointsOfInterest": "false",
"brief": "false",
"outline": "false",
"highlights": "false",
"callOutcome": "false",
"keyPoints": "false",
},
optional: true,
},
exposedFieldsInteraction: {
type: "object",
label: "Exposed Fields Interaction",
description: "Specify which fields to include in the response for the interaction. Example object: {'speakers': true, 'video': true, 'personInteractionStats': true, 'questions': true}",
default: {
"speakers": "false",
"video": "false",
"personInteractionStats": "false",
"questions": "false",
},
optional: true,
},
includePublicComments: {
type: "boolean",
label: "Include Public Comments",
description: "Whether to include public comments in the response",
default: false,
optional: true,
},
includeMedia: {
type: "boolean",
label: "Include Media",
description: "Whether to include media in the response",
default: false,
optional: true,
},
},
methods: {
getExtensiveData(args = {}) {
Expand All @@ -68,20 +138,63 @@ export default {
app,
getExtensiveData,
maxResults,
context,
contextTiming,
includeParties,
exposedFieldsContent,
exposedFieldsInteraction,
includePublicComments,
includeMedia,
...filter
} = this;

if (filter?.workspaceId && filter?.callIds) {
throw new ConfigurationError("Must not provide both `callIds` and `workspaceId`");
}

const exposedFieldsContentObj = utils.parseObject(exposedFieldsContent);
const exposedFieldsInteractionObj = utils.parseObject(exposedFieldsInteraction);

const contentSelector = {
"context": context || "None",
...(contextTiming?.length > 0 && {
"contextTiming": contextTiming,
}),
"exposedFields": {
"parties": includeParties || false,
"content": {
"structure": exposedFieldsContentObj?.structure || false,
"topics": exposedFieldsContentObj?.topics || false,
"trackers": exposedFieldsContentObj?.trackers || false,
"trackerOccurrences": exposedFieldsContentObj?.trackerOccurrences || false,
"pointsOfInterest": exposedFieldsContentObj?.pointsOfInterest || false,
"brief": exposedFieldsContentObj?.brief || false,
"outline": exposedFieldsContentObj?.outline || false,
"highlights": exposedFieldsContentObj?.highlights || false,
"callOutcome": exposedFieldsContentObj?.callOutcome || false,
"keyPoints": exposedFieldsContentObj?.keyPoints || false,
},
"interaction": {
"speakers": exposedFieldsInteractionObj?.speakers || false,
"video": exposedFieldsInteractionObj?.video || false,
"personInteractionStats": exposedFieldsInteractionObj?.personInteractionStats || false,
"questions": exposedFieldsInteractionObj?.questions || false,
},
"collaboration": {
"publicComments": includePublicComments || false,
},
"media": includeMedia || false,
},
};

try {
const calls = await app.paginate({
resourceFn: getExtensiveData,
resourceFnArgs: {
step: $,
data: {
filter,
contentSelector,
},
},
resourceName: "calls",
Expand Down
2 changes: 1 addition & 1 deletion components/gong/actions/list-calls/list-calls.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
name: "List calls",
description: "List calls. [See the documentation](https://us-66463.app.gong.io/settings/api/documentation#get-/v2/calls)",
type: "action",
version: "0.0.2",
version: "0.0.3",
props: {
app,
fromDateTime: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
name: "Retrieve Transcripts Of Calls",
description: "Retrieve transcripts of calls. [See the documentation](https://us-66463.app.gong.io/settings/api/documentation#post-/v2/calls/transcript)",
type: "action",
version: "0.0.3",
version: "0.0.4",
props: {
app,
fromDateTime: {
Expand Down
30 changes: 28 additions & 2 deletions components/gong/common/utils.mjs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { ConfigurationError } from "@pipedream/platform";

function emptyStrToUndefined(value) {
const trimmed = typeof(value) === "string" && value.trim();
const trimmed = typeof (value) === "string" && value.trim();
return trimmed === ""
? undefined
: value;
}

function parse(value) {
const valueToParse = emptyStrToUndefined(value);
if (typeof(valueToParse) === "object" || valueToParse === undefined) {
if (typeof (valueToParse) === "object" || valueToParse === undefined) {
return valueToParse;
}
try {
Expand Down Expand Up @@ -42,6 +42,31 @@ function parseArray(value) {
}
}

function parseObject(obj) {
if (!obj) return undefined;

if (Array.isArray(obj)) {
return obj.map((item) => {
if (typeof item === "string") {
try {
return JSON.parse(item);
} catch (e) {
return item;
}
}
return item;
});
}
if (typeof obj === "string") {
try {
return JSON.parse(obj);
} catch (e) {
return obj;
}
}
return obj;
};

async function streamIterator(stream) {
const resources = [];
for await (const resource of stream) {
Expand All @@ -52,6 +77,7 @@ async function streamIterator(stream) {

export default {
parseArray,
parseObject,
parse,
streamIterator,
};
2 changes: 1 addition & 1 deletion components/gong/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/gong",
"version": "0.2.0",
"version": "0.3.0",
"description": "Pipedream Gong Components",
"main": "gong.app.mjs",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion components/gong/sources/new-call/new-call.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
...common,
key: "gong-new-call",
name: "New Call",
description: "Triggers when a new call is added. [See the documentation](https://us-66463.app.gong.io/settings/api/documentation#get-/v2/calls)",

Check warning on line 7 in components/gong/sources/new-call/new-call.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Source descriptions should start with "Emit new". See https://pipedream.com/docs/components/guidelines/#source-description
type: "source",
version: "0.0.2",
version: "0.0.3",
dedupe: "unique",
methods: {
...common.methods,
Expand Down
Loading