Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import fathom from "../../fathom.app.mjs";

export default {
key: "fathom-get-recording-summary",
name: "Get Recording Summary",
description: "Get the summary of a recording. [See the documentation](https://developers.fathom.ai/api-reference/recordings/get-summary)",
version: "0.0.1",
type: "action",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: true,
},
props: {
fathom,
recordingId: {
propDefinition: [
fathom,
"recordingId",
],
},
},
async run({ $ }) {
const response = await this.fathom.getRecordingSummary({
$,
recordingId: this.recordingId,
});
$.export("$summary", `Successfully fetched recording summary for recording ID: ${this.recordingId}`);
return response;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import fathom from "../../fathom.app.mjs";

export default {
key: "fathom-get-recording-transcript",
name: "Get Recording Transcript",
description: "Get the transcript of a recording. [See the documentation](https://developers.fathom.ai/api-reference/recordings/get-transcript)",
version: "0.0.1",
type: "action",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: true,
},
props: {
fathom,
recordingId: {
propDefinition: [
fathom,
"recordingId",
],
},
},
async run({ $ }) {
const response = await this.fathom.getRecordingTranscript({
$,
recordingId: this.recordingId,
});
$.export("$summary", `Successfully fetched recording transcript for recording ID: ${this.recordingId}`);
return response;
},
};
63 changes: 63 additions & 0 deletions components/fathom/actions/list-meetings/list-meetings.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import fathom from "../../fathom.app.mjs";

export default {
key: "fathom-list-meetings",
name: "List Meetings",
description: "List meetings. [See the documentation](https://developers.fathom.ai/api-reference/meetings/list-meetings)",
version: "0.0.1",
type: "action",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: true,
},
props: {
fathom,
includeActionItems: {
propDefinition: [
fathom,
"includeActionItems",
],
},
includeCrmMatches: {
propDefinition: [
fathom,
"includeCrmMatches",
],
},
createdAfter: {
type: "string",
label: "Created After",
description: "Filter to meetings with created_at after this timestamp, e.g. `2025-01-01T00:00:00Z`",
optional: true,
},
createdBefore: {
type: "string",
label: "Created Before",
description: "Filter to meetings with created_at before this timestamp, e.g. `2025-01-01T00:00:00Z`",
optional: true,
},
cursor: {
type: "string",
label: "Cursor",
description: "The cursor to start from",
optional: true,
},
},
async run({ $ }) {
const response = await this.fathom.listMeetings({
$,
params: {
include_action_items: this.includeActionItems,
include_crm_matches: this.includeCrmMatches,
include_summary: this.includeSummary,
include_transcript: this.includeTranscript,
created_after: this.createdAfter,
created_before: this.createdBefore,
cursor: this.cursor,
},
});
$.export("$summary", `Successfully listed ${response?.items?.length} meetings`);
return response;
},
};
112 changes: 107 additions & 5 deletions components/fathom/fathom.app.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,113 @@
import { axios } from "@pipedream/platform";

export default {
type: "app",
app: "fathom",
propDefinitions: {},
propDefinitions: {
recordingId: {
type: "string",
label: "Recording ID",
description: "The ID of a recording",
async options({ prevContext }) {
const {
items, next_cursor: next,
} = await this.listMeetings({
params: {
cursor: prevContext?.cursor,
},
});
return {
options: items.map(({
recording_id: value, title: label,
}) => ({
label,
value,
})),
context: {
cursor: next,
},
};
},
},
includeActionItems: {
type: "boolean",
label: "Include Action Items",
description: "Include the action items for each meeting",
optional: true,
},
includeCrmMatches: {
type: "boolean",
label: "Include CRM Matches",
description: "Include CRM matches for each meeting. Only returns data from your or your team's linked CRM.",
optional: true,
},
includeSummary: {
type: "boolean",
label: "Include Summary",
description: "Include the summary for each meeting",
optional: true,
},
includeTranscript: {
type: "boolean",
label: "Include Transcript",
description: "Include the transcript for each meeting",
optional: true,
},
},
methods: {
// this.$auth contains connected account data
authKeys() {
console.log(Object.keys(this.$auth));
_baseUrl() {
return "https://api.fathom.ai/external/v1";
},
_makeRequest({
$ = this,
path,
...opts
}) {
return axios($, {
url: `${this._baseUrl()}${path}`,
headers: {
Authorization: `Bearer ${this.$auth.oauth_access_token}`,
},
...opts,
});
},
createWebhook(opts = {}) {
return this._makeRequest({
path: "/webhooks",
method: "POST",
...opts,
});
},
deleteWebhook({
webhookId, ...opts
}) {
return this._makeRequest({
path: `/webhooks/${webhookId}`,
method: "DELETE",
...opts,
});
},
listMeetings(opts = {}) {
return this._makeRequest({
path: "/meetings",
...opts,
});
},
getRecordingSummary({
recordingId, ...opts
}) {
return this._makeRequest({
path: `/recordings/${recordingId}/summary`,
...opts,
});
},
getRecordingTranscript({
recordingId, ...opts
}) {
return this._makeRequest({
path: `/recordings/${recordingId}/transcript`,
...opts,
});
},
},
};
};
7 changes: 5 additions & 2 deletions components/fathom/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/fathom",
"version": "0.0.1",
"version": "0.1.0",
"description": "Pipedream Fathom Components",
"main": "fathom.app.mjs",
"keywords": [
Expand All @@ -11,5 +11,8 @@
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
"publishConfig": {
"access": "public"
},
"dependencies": {
"@pipedream/platform": "^3.1.0"
}
}
}
87 changes: 87 additions & 0 deletions components/fathom/sources/common/base-webhook.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
import fathom from "../../fathom.app.mjs";
import { ConfigurationError } from "@pipedream/platform";

export default {
props: {
fathom,
db: "$.service.db",
http: "$.interface.http",
includeActionItems: {
propDefinition: [
fathom,
"includeActionItems",
],
},
includeCrmMatches: {
propDefinition: [
fathom,
"includeCrmMatches",
],
},
includeSummary: {
propDefinition: [
fathom,
"includeSummary",
],
},
includeTranscript: {
propDefinition: [
fathom,
"includeTranscript",
],
},
},
hooks: {
async activate() {
if (
!this.includeTranscript
&& !this.includeSummary
&& !this.includeCrmMatches
&& !this.includeActionItems)
{
throw new ConfigurationError("At least one of includeTranscript, includeSummary, includeCrmMatches, or includeActionItems must be true");
}

const { id } = await this.fathom.createWebhook({
data: {
destination_url: this.http.endpoint,
...this.getWebhookData(),
},
});

this._setWebhookId(id);
},
async deactivate() {
const webhookId = this._getWebhookId();
if (webhookId) {
await this.fathom.deleteWebhook({
webhookId,
});
}
},
},
methods: {
_getWebhookId() {
return this.db.get("webhookId");
},
_setWebhookId(webhookId) {
this.db.set("webhookId", webhookId);
},
getWebhookData() {
throw new ConfigurationError("getWebhookData is not implemented");
},
generateMeta() {
throw new ConfigurationError("generateMeta is not implemented");
},
},
async run(event) {
const { body } = event;

if (!body) {
return;
}

const meta = this.generateMeta(body);
this.$emit(body, meta);
},
};
Loading
Loading