Skip to content

Gong - Get Extensive Data Action #16106

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

Merged
merged 10 commits into from
Apr 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
105 changes: 105 additions & 0 deletions components/gong/actions/get-extensive-data/get-extensive-data.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
import app from "../../gong.app.mjs";
import constants from "../../common/constants.mjs";
import { ConfigurationError } from "@pipedream/platform";

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",
type: "action",
props: {
app,
fromDateTime: {
propDefinition: [
app,
"fromDateTime",
],
optional: true,
},
toDateTime: {
propDefinition: [
app,
"toDateTime",
],
optional: true,
},
workspaceId: {
optional: true,
propDefinition: [
app,
"workspaceId",
],
},
callIds: {
propDefinition: [
app,
"callIds",
],
},
primaryUserIds: {
type: "string[]",
label: "Primary User IDs",
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.",
propDefinition: [
app,
"userId",
],
optional: true,
},
maxResults: {
type: "integer",
label: "Max Results",
description: "The maximum number or results to return",
default: constants.DEFAULT_MAX,
optional: true,
},
},
methods: {
getExtensiveData(args = {}) {
return this.app.post({
path: "/calls/extensive",
...args,
});
},
},
async run({ $ }) {
const {
app,
getExtensiveData,
maxResults,
...filter
} = this;

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

try {
const calls = await app.paginate({
resourceFn: getExtensiveData,
resourceFnArgs: {
step: $,
data: {
filter,
},
},
resourceName: "calls",
max: maxResults,
});

if (calls?.length) {
$.export("$summary", `Successfully retrieved data for ${calls.length} calls`);
}
return calls;
}
catch (error) {
const noCallsMessage = "No calls found corresponding to the provided filters";
if (error?.message.includes(noCallsMessage)) {
$.export("$summary", noCallsMessage);
} else {
throw new ConfigurationError(`${error?.message}`);
}
}
},
};
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.1.2",
"version": "0.2.0",
"description": "Pipedream Gong Components",
"main": "gong.app.mjs",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion components/notiff_io/notiff_io.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
console.log(Object.keys(this.$auth));
},
},
};
};
2 changes: 1 addition & 1 deletion components/smartlead/smartlead.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
console.log(Object.keys(this.$auth));
},
},
};
};
Loading