Skip to content

Commit 63c13d8

Browse files
committed
feat: add content selector
1 parent e08c027 commit 63c13d8

File tree

1 file changed

+112
-2
lines changed

1 file changed

+112
-2
lines changed

components/gong/actions/get-extensive-data/get-extensive-data.mjs

Lines changed: 112 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import { ConfigurationError } from "@pipedream/platform";
55
export default {
66
key: "gong-get-extensive-data",
77
name: "Get Extensive Data",
8-
description: "Lists detailed call data. [See the documentation](https://us-66463.app.gong.io/settings/api/documentation#post-/v2/calls/extensive)",
9-
version: "0.0.1",
8+
description: "Lists detailed call data. [See the documentation](https://gong.app.gong.io/settings/api/documentation#post-/v2/calls/extensive)",
9+
version: "0.0.2",
1010
type: "action",
1111
props: {
1212
app,
@@ -54,6 +54,76 @@ export default {
5454
default: constants.DEFAULT_MAX,
5555
optional: true,
5656
},
57+
context: {
58+
type: "string",
59+
label: "Context",
60+
description: "Allowed: None, Basic, Extended. 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. Default value 'None'",
61+
options: [
62+
"None",
63+
"Basic",
64+
"Extended",
65+
],
66+
default: "None",
67+
optional: true,
68+
},
69+
contextTiming: {
70+
type: "string[]",
71+
label: "Context Timing",
72+
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'",
73+
default: [],
74+
optional: true,
75+
},
76+
includeParties: {
77+
type: "boolean",
78+
label: "Include Parties",
79+
description: "Whether to include parties in the response",
80+
default: false,
81+
optional: true,
82+
},
83+
exposedFieldsContent: {
84+
type: "object",
85+
label: "Exposed Fields Content",
86+
description: "Specify which fields to include in the response for the content",
87+
default: {
88+
"structure": false,
89+
"topics": false,
90+
"trackers": false,
91+
"trackerOccurrences": false,
92+
"pointsOfInterest": false,
93+
"brief": false,
94+
"outline": false,
95+
"highlights": false,
96+
"callOutcome": false,
97+
"keyPoints": false,
98+
},
99+
optional: true,
100+
},
101+
exposedFieldsInteraction: {
102+
type: "object",
103+
label: "Exposed Fields Interaction",
104+
description: "Specify which fields to include in the response for the interaction",
105+
default: {
106+
"speakers": false,
107+
"video": false,
108+
"personInteractionStats": false,
109+
"questions": false,
110+
},
111+
optional: true,
112+
},
113+
includePublicComments: {
114+
type: "boolean",
115+
label: "Include Public Comments",
116+
description: "Whether to include public comments in the response",
117+
default: false,
118+
optional: true,
119+
},
120+
includeMedia: {
121+
type: "boolean",
122+
label: "Include Media",
123+
description: "Whether to include media in the response",
124+
default: false,
125+
optional: true,
126+
},
57127
},
58128
methods: {
59129
getExtensiveData(args = {}) {
@@ -68,20 +138,60 @@ export default {
68138
app,
69139
getExtensiveData,
70140
maxResults,
141+
context,
142+
contextTiming,
143+
includeParties,
144+
exposedFieldsContent,
145+
exposedFieldsInteraction,
146+
includePublicComments,
147+
includeMedia,
71148
...filter
72149
} = this;
73150

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

155+
const contentSelector = {
156+
"context": context || "None",
157+
...(contextTiming.length > 0 && {
158+
"contextTiming": contextTiming,
159+
}),
160+
"exposedFields": {
161+
"parties": includeParties || false,
162+
"content": {
163+
"structure": exposedFieldsContent.structure || false,
164+
"topics": exposedFieldsContent.topics || false,
165+
"trackers": exposedFieldsContent.trackers || false,
166+
"trackerOccurrences": exposedFieldsContent.trackerOccurrences || false,
167+
"pointsOfInterest": exposedFieldsContent.pointsOfInterest || false,
168+
"brief": exposedFieldsContent.brief || false,
169+
"outline": exposedFieldsContent.outline || false,
170+
"highlights": exposedFieldsContent.highlights || false,
171+
"callOutcome": exposedFieldsContent.callOutcome || false,
172+
"keyPoints": exposedFieldsContent.keyPoints || false,
173+
},
174+
"interaction": {
175+
"speakers": exposedFieldsInteraction.speakers || false,
176+
"video": exposedFieldsInteraction.video || false,
177+
"personInteractionStats": exposedFieldsInteraction.personInteractionStats || false,
178+
"questions": exposedFieldsInteraction.questions || false,
179+
},
180+
"collaboration": {
181+
"publicComments": includePublicComments || false,
182+
},
183+
"media": includeMedia || false,
184+
},
185+
};
186+
78187
try {
79188
const calls = await app.paginate({
80189
resourceFn: getExtensiveData,
81190
resourceFnArgs: {
82191
step: $,
83192
data: {
84193
filter,
194+
contentSelector,
85195
},
86196
},
87197
resourceName: "calls",

0 commit comments

Comments
 (0)