Skip to content

Commit 0ae47eb

Browse files
jocarinojoaojoaocoformjcortesmichelle0927
authored
Merging pull request #18090
* fix: pagination prop and params struct * fix: no need for paginate here * chore: update version * chore: cleanup * chore: update package * feat: allow raw response * chore: bump package * fix: buffer response instead * Update components/google_drive/actions/download-file/download-file.mjs Co-authored-by: Jorge Cortes <[email protected]> * versions * pnpm-lock.yaml * pnpm-lock.yaml * pnpm-lock.yaml * feat: add content selector * chore: bump package * fix: comments * chore: bump versions * chore: fix versions * fixes: QA fixes --------- Co-authored-by: joao <[email protected]> Co-authored-by: joaocoform <[email protected]> Co-authored-by: Jorge Cortes <[email protected]> Co-authored-by: Michelle Bergeron <[email protected]> Co-authored-by: Luan Cazarine <[email protected]>
1 parent fbae1ff commit 0ae47eb

File tree

7 files changed

+148
-9
lines changed

7 files changed

+148
-9
lines changed

components/gong/actions/add-new-call/add-new-call.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default {
88
name: "Add New Call",
99
description: "Add a new call. [See the documentation](https://us-66463.app.gong.io/settings/api/documentation#post-/v2/calls)",
1010
type: "action",
11-
version: "0.0.2",
11+
version: "0.0.3",
1212
props: {
1313
app,
1414
clientUniqueId: {

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

Lines changed: 115 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import app from "../../gong.app.mjs";
22
import constants from "../../common/constants.mjs";
33
import { ConfigurationError } from "@pipedream/platform";
4+
import utils from "../../common/utils.mjs";
45

56
export default {
67
key: "gong-get-extensive-data",
78
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",
9+
description: "Lists detailed call data. [See the documentation](https://gong.app.gong.io/settings/api/documentation#post-/v2/calls/extensive)",
10+
version: "0.0.3",
1011
type: "action",
1112
props: {
1213
app,
@@ -54,6 +55,75 @@ export default {
5455
default: constants.DEFAULT_MAX,
5556
optional: true,
5657
},
58+
context: {
59+
type: "string",
60+
label: "Context",
61+
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.",
62+
options: [
63+
"None",
64+
"Basic",
65+
"Extended",
66+
],
67+
default: "None",
68+
optional: true,
69+
},
70+
contextTiming: {
71+
type: "string[]",
72+
label: "Context Timing",
73+
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'",
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. Example object: {'structure': false, 'topics': false, 'trackers': false, 'trackerOccurrences': false, 'pointsOfInterest': false, 'brief': true, 'outline': true, 'highlights': true, 'callOutcome': true, 'keyPoints': true}",
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. Example object: {'speakers': true, 'video': true, 'personInteractionStats': true, 'questions': true}",
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,63 @@ 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 exposedFieldsContentObj = utils.parseObject(exposedFieldsContent);
156+
const exposedFieldsInteractionObj = utils.parseObject(exposedFieldsInteraction);
157+
158+
const contentSelector = {
159+
"context": context || "None",
160+
...(contextTiming?.length > 0 && {
161+
"contextTiming": contextTiming,
162+
}),
163+
"exposedFields": {
164+
"parties": includeParties || false,
165+
"content": {
166+
"structure": exposedFieldsContentObj?.structure || false,
167+
"topics": exposedFieldsContentObj?.topics || false,
168+
"trackers": exposedFieldsContentObj?.trackers || false,
169+
"trackerOccurrences": exposedFieldsContentObj?.trackerOccurrences || false,
170+
"pointsOfInterest": exposedFieldsContentObj?.pointsOfInterest || false,
171+
"brief": exposedFieldsContentObj?.brief || false,
172+
"outline": exposedFieldsContentObj?.outline || false,
173+
"highlights": exposedFieldsContentObj?.highlights || false,
174+
"callOutcome": exposedFieldsContentObj?.callOutcome || false,
175+
"keyPoints": exposedFieldsContentObj?.keyPoints || false,
176+
},
177+
"interaction": {
178+
"speakers": exposedFieldsInteractionObj?.speakers || false,
179+
"video": exposedFieldsInteractionObj?.video || false,
180+
"personInteractionStats": exposedFieldsInteractionObj?.personInteractionStats || false,
181+
"questions": exposedFieldsInteractionObj?.questions || false,
182+
},
183+
"collaboration": {
184+
"publicComments": includePublicComments || false,
185+
},
186+
"media": includeMedia || false,
187+
},
188+
};
189+
78190
try {
79191
const calls = await app.paginate({
80192
resourceFn: getExtensiveData,
81193
resourceFnArgs: {
82194
step: $,
83195
data: {
84196
filter,
197+
contentSelector,
85198
},
86199
},
87200
resourceName: "calls",

components/gong/actions/list-calls/list-calls.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
name: "List calls",
66
description: "List calls. [See the documentation](https://us-66463.app.gong.io/settings/api/documentation#get-/v2/calls)",
77
type: "action",
8-
version: "0.0.2",
8+
version: "0.0.3",
99
props: {
1010
app,
1111
fromDateTime: {

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

Lines changed: 1 addition & 1 deletion
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.3",
8+
version: "0.0.4",
99
props: {
1010
app,
1111
fromDateTime: {

components/gong/common/utils.mjs

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import { ConfigurationError } from "@pipedream/platform";
22

33
function emptyStrToUndefined(value) {
4-
const trimmed = typeof(value) === "string" && value.trim();
4+
const trimmed = typeof (value) === "string" && value.trim();
55
return trimmed === ""
66
? undefined
77
: value;
88
}
99

1010
function parse(value) {
1111
const valueToParse = emptyStrToUndefined(value);
12-
if (typeof(valueToParse) === "object" || valueToParse === undefined) {
12+
if (typeof (valueToParse) === "object" || valueToParse === undefined) {
1313
return valueToParse;
1414
}
1515
try {
@@ -42,6 +42,31 @@ function parseArray(value) {
4242
}
4343
}
4444

45+
function parseObject(obj) {
46+
if (!obj) return undefined;
47+
48+
if (Array.isArray(obj)) {
49+
return obj.map((item) => {
50+
if (typeof item === "string") {
51+
try {
52+
return JSON.parse(item);
53+
} catch (e) {
54+
return item;
55+
}
56+
}
57+
return item;
58+
});
59+
}
60+
if (typeof obj === "string") {
61+
try {
62+
return JSON.parse(obj);
63+
} catch (e) {
64+
return obj;
65+
}
66+
}
67+
return obj;
68+
};
69+
4570
async function streamIterator(stream) {
4671
const resources = [];
4772
for await (const resource of stream) {
@@ -52,6 +77,7 @@ async function streamIterator(stream) {
5277

5378
export default {
5479
parseArray,
80+
parseObject,
5581
parse,
5682
streamIterator,
5783
};

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.2.0",
3+
"version": "0.3.0",
44
"description": "Pipedream Gong Components",
55
"main": "gong.app.mjs",
66
"keywords": [

components/gong/sources/new-call/new-call.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
name: "New Call",
77
description: "Triggers when a new call is added. [See the documentation](https://us-66463.app.gong.io/settings/api/documentation#get-/v2/calls)",
88
type: "source",
9-
version: "0.0.2",
9+
version: "0.0.3",
1010
dedupe: "unique",
1111
methods: {
1212
...common.methods,

0 commit comments

Comments
 (0)