Skip to content
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
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;
},
};
61 changes: 61 additions & 0 deletions components/fathom/actions/list-meetings/list-meetings.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
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: "If continuing a previous request, 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,
created_after: this.createdAfter,
created_before: this.createdBefore,
cursor: this.cursor,
},
});
$.export("$summary", `Successfully listed ${response?.items?.length} meetings`);
return response;
},
};
100 changes: 95 additions & 5 deletions components/fathom/fathom.app.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,101 @@
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,
},
},
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"
}
}
}
65 changes: 65 additions & 0 deletions components/fathom/sources/common/base-webhook.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import fathom from "../../fathom.app.mjs";
import { ConfigurationError } from "@pipedream/platform";

export default {
props: {
fathom,
db: "$.service.db",
http: "$.interface.http",
include: {
type: "string[]",
label: "Include Fields",
description: "Fields to include in the webhook payload",
options: [
"action_items",
"crm_matches",
"summary",
"transcript",
],
},
},
hooks: {
async activate() {
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);
},
};
46 changes: 46 additions & 0 deletions components/fathom/sources/new-recording/new-recording.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import common from "../common/base-webhook.mjs";
import sampleEmit from "./test-event.mjs";

export default {
...common,
key: "fathom-new-recording",
name: "New Recording (Instant)",
description: "Emit new event when a new recording is created. [See the documentation](https://developers.fathom.ai/api-reference/webhooks/create-a-webhook)",
version: "0.0.1",
type: "source",
dedupe: "unique",
props: {
...common.props,
triggeredFor: {
type: "string[]",
label: "Triggered For",
description: "The types of recordings to trigger the webhook",
options: [
"my_recordings",
"shared_external_recordings",
"my_shared_with_team_recordings",
"shared_team_recordings",
],
},
},
methods: {
...common.methods,
getWebhookData() {
return {
triggered_for: this.triggeredFor,
include_action_items: this.include.includes("action_items"),
include_crm_matches: this.include.includes("crm_matches"),
include_summary: this.include.includes("summary"),
include_transcript: this.include.includes("transcript"),
};
},
generateMeta(event) {
return {
id: event.recording_id,
summary: `New recording: ${event.recording_id}`,
ts: Date.now(),
};
},
},
sampleEmit,
};
Loading
Loading