Skip to content

Commit 0ea21ee

Browse files
committed
get-extensive-data
1 parent 9184b99 commit 0ea21ee

File tree

2 files changed

+91
-1
lines changed

2 files changed

+91
-1
lines changed
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
import app from "../../gong.app.mjs";
2+
import constants from "../../common/constants.mjs";
3+
4+
export default {
5+
key: "gong-get-extensive-data",
6+
name: "Get Extensive Data",
7+
description: "Lists detailed call data. [See the documentation](https://us-66463.app.gong.io/settings/api/documentation#post-/v2/calls/extensive)",
8+
version: "0.0.1",
9+
type: "action",
10+
props: {
11+
app,
12+
fromDateTime: {
13+
propDefinition: [
14+
app,
15+
"fromDateTime",
16+
],
17+
optional: true,
18+
},
19+
toDateTime: {
20+
propDefinition: [
21+
app,
22+
"toDateTime",
23+
],
24+
optional: true,
25+
},
26+
workspaceId: {
27+
optional: true,
28+
propDefinition: [
29+
app,
30+
"workspaceId",
31+
],
32+
},
33+
callIds: {
34+
propDefinition: [
35+
app,
36+
"callIds",
37+
],
38+
},
39+
primaryUserIds: {
40+
type: "string[]",
41+
label: "Primary User IDs",
42+
description: "An optional list of user identifiers, if supplied the API will return only the calls hosted by the specified users. The identifiers in this field match the primaryUserId field of the calls.",
43+
propDefinition: [
44+
app,
45+
"userId",
46+
],
47+
optional: true,
48+
},
49+
maxResults: {
50+
type: "integer",
51+
label: "Max Results",
52+
description: "The maximum number or results to return",
53+
default: constants.DEFAULT_MAX,
54+
optional: true,
55+
},
56+
},
57+
methods: {
58+
getExtensiveData(args = {}) {
59+
return this.app.post({
60+
path: "/calls/extensive",
61+
...args,
62+
});
63+
},
64+
},
65+
async run({ $ }) {
66+
const {
67+
app,
68+
getExtensiveData,
69+
maxResults,
70+
...filter
71+
} = this;
72+
73+
const calls = await app.paginate({
74+
resourceFn: getExtensiveData,
75+
resourceFnArgs: {
76+
$,
77+
data: {
78+
filter,
79+
},
80+
},
81+
resourceName: "calls",
82+
max: maxResults,
83+
});
84+
85+
if (calls?.length) {
86+
$.export("$summary", `Successfully retrieved data for ${calls.length} calls`);
87+
}
88+
return calls;
89+
},
90+
};

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

0 commit comments

Comments
 (0)