Skip to content

Commit 99ba936

Browse files
Merge branch 'master' into workday-update-base-url
2 parents 273633f + 6d19333 commit 99ba936

File tree

12 files changed

+576
-19
lines changed

12 files changed

+576
-19
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import fathom from "../../fathom.app.mjs";
2+
3+
export default {
4+
key: "fathom-get-recording-summary",
5+
name: "Get Recording Summary",
6+
description: "Get the summary of a recording. [See the documentation](https://developers.fathom.ai/api-reference/recordings/get-summary)",
7+
version: "0.0.1",
8+
type: "action",
9+
annotations: {
10+
destructiveHint: false,
11+
openWorldHint: true,
12+
readOnlyHint: true,
13+
},
14+
props: {
15+
fathom,
16+
recordingId: {
17+
propDefinition: [
18+
fathom,
19+
"recordingId",
20+
],
21+
},
22+
},
23+
async run({ $ }) {
24+
const response = await this.fathom.getRecordingSummary({
25+
$,
26+
recordingId: this.recordingId,
27+
});
28+
$.export("$summary", `Successfully fetched recording summary for recording ID: ${this.recordingId}`);
29+
return response;
30+
},
31+
};
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import fathom from "../../fathom.app.mjs";
2+
3+
export default {
4+
key: "fathom-get-recording-transcript",
5+
name: "Get Recording Transcript",
6+
description: "Get the transcript of a recording. [See the documentation](https://developers.fathom.ai/api-reference/recordings/get-transcript)",
7+
version: "0.0.1",
8+
type: "action",
9+
annotations: {
10+
destructiveHint: false,
11+
openWorldHint: true,
12+
readOnlyHint: true,
13+
},
14+
props: {
15+
fathom,
16+
recordingId: {
17+
propDefinition: [
18+
fathom,
19+
"recordingId",
20+
],
21+
},
22+
},
23+
async run({ $ }) {
24+
const response = await this.fathom.getRecordingTranscript({
25+
$,
26+
recordingId: this.recordingId,
27+
});
28+
$.export("$summary", `Successfully fetched recording transcript for recording ID: ${this.recordingId}`);
29+
return response;
30+
},
31+
};
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import fathom from "../../fathom.app.mjs";
2+
3+
export default {
4+
key: "fathom-list-meetings",
5+
name: "List Meetings",
6+
description: "List meetings. [See the documentation](https://developers.fathom.ai/api-reference/meetings/list-meetings)",
7+
version: "0.0.1",
8+
type: "action",
9+
annotations: {
10+
destructiveHint: false,
11+
openWorldHint: true,
12+
readOnlyHint: true,
13+
},
14+
props: {
15+
fathom,
16+
includeActionItems: {
17+
propDefinition: [
18+
fathom,
19+
"includeActionItems",
20+
],
21+
},
22+
includeCrmMatches: {
23+
propDefinition: [
24+
fathom,
25+
"includeCrmMatches",
26+
],
27+
},
28+
createdAfter: {
29+
type: "string",
30+
label: "Created After",
31+
description: "Filter to meetings with created_at after this timestamp, e.g. `2025-01-01T00:00:00Z`",
32+
optional: true,
33+
},
34+
createdBefore: {
35+
type: "string",
36+
label: "Created Before",
37+
description: "Filter to meetings with created_at before this timestamp, e.g. `2025-01-01T00:00:00Z`",
38+
optional: true,
39+
},
40+
cursor: {
41+
type: "string",
42+
label: "Cursor",
43+
description: "If continuing a previous request, the cursor to start from",
44+
optional: true,
45+
},
46+
},
47+
async run({ $ }) {
48+
const response = await this.fathom.listMeetings({
49+
$,
50+
params: {
51+
include_action_items: this.includeActionItems,
52+
include_crm_matches: this.includeCrmMatches,
53+
created_after: this.createdAfter,
54+
created_before: this.createdBefore,
55+
cursor: this.cursor,
56+
},
57+
});
58+
$.export("$summary", `Successfully listed ${response?.items?.length} meetings`);
59+
return response;
60+
},
61+
};

components/fathom/fathom.app.mjs

Lines changed: 95 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,101 @@
1+
import { axios } from "@pipedream/platform";
2+
13
export default {
24
type: "app",
35
app: "fathom",
4-
propDefinitions: {},
6+
propDefinitions: {
7+
recordingId: {
8+
type: "string",
9+
label: "Recording ID",
10+
description: "The ID of a recording",
11+
async options({ prevContext }) {
12+
const {
13+
items, next_cursor: next,
14+
} = await this.listMeetings({
15+
params: {
16+
cursor: prevContext?.cursor,
17+
},
18+
});
19+
return {
20+
options: items.map(({
21+
recording_id: value, title: label,
22+
}) => ({
23+
label,
24+
value,
25+
})),
26+
context: {
27+
cursor: next,
28+
},
29+
};
30+
},
31+
},
32+
includeActionItems: {
33+
type: "boolean",
34+
label: "Include Action Items",
35+
description: "Include the action items for each meeting",
36+
optional: true,
37+
},
38+
includeCrmMatches: {
39+
type: "boolean",
40+
label: "Include CRM Matches",
41+
description: "Include CRM matches for each meeting. Only returns data from your or your team's linked CRM.",
42+
optional: true,
43+
},
44+
},
545
methods: {
6-
// this.$auth contains connected account data
7-
authKeys() {
8-
console.log(Object.keys(this.$auth));
46+
_baseUrl() {
47+
return "https://api.fathom.ai/external/v1";
48+
},
49+
_makeRequest({
50+
$ = this,
51+
path,
52+
...opts
53+
}) {
54+
return axios($, {
55+
url: `${this._baseUrl()}${path}`,
56+
headers: {
57+
Authorization: `Bearer ${this.$auth.oauth_access_token}`,
58+
},
59+
...opts,
60+
});
61+
},
62+
createWebhook(opts = {}) {
63+
return this._makeRequest({
64+
path: "/webhooks",
65+
method: "POST",
66+
...opts,
67+
});
68+
},
69+
deleteWebhook({
70+
webhookId, ...opts
71+
}) {
72+
return this._makeRequest({
73+
path: `/webhooks/${webhookId}`,
74+
method: "DELETE",
75+
...opts,
76+
});
77+
},
78+
listMeetings(opts = {}) {
79+
return this._makeRequest({
80+
path: "/meetings",
81+
...opts,
82+
});
83+
},
84+
getRecordingSummary({
85+
recordingId, ...opts
86+
}) {
87+
return this._makeRequest({
88+
path: `/recordings/${recordingId}/summary`,
89+
...opts,
90+
});
91+
},
92+
getRecordingTranscript({
93+
recordingId, ...opts
94+
}) {
95+
return this._makeRequest({
96+
path: `/recordings/${recordingId}/transcript`,
97+
...opts,
98+
});
999
},
10100
},
11-
};
101+
};

components/fathom/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/fathom",
3-
"version": "0.0.1",
3+
"version": "0.1.0",
44
"description": "Pipedream Fathom Components",
55
"main": "fathom.app.mjs",
66
"keywords": [
@@ -11,5 +11,8 @@
1111
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
1212
"publishConfig": {
1313
"access": "public"
14+
},
15+
"dependencies": {
16+
"@pipedream/platform": "^3.1.0"
1417
}
15-
}
18+
}
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
import fathom from "../../fathom.app.mjs";
2+
import { ConfigurationError } from "@pipedream/platform";
3+
4+
export default {
5+
props: {
6+
fathom,
7+
db: "$.service.db",
8+
http: "$.interface.http",
9+
include: {
10+
type: "string[]",
11+
label: "Include Fields",
12+
description: "Fields to include in the webhook payload",
13+
options: [
14+
"action_items",
15+
"crm_matches",
16+
"summary",
17+
"transcript",
18+
],
19+
},
20+
},
21+
hooks: {
22+
async activate() {
23+
const { id } = await this.fathom.createWebhook({
24+
data: {
25+
destination_url: this.http.endpoint,
26+
...this.getWebhookData(),
27+
},
28+
});
29+
30+
this._setWebhookId(id);
31+
},
32+
async deactivate() {
33+
const webhookId = this._getWebhookId();
34+
if (webhookId) {
35+
await this.fathom.deleteWebhook({
36+
webhookId,
37+
});
38+
}
39+
},
40+
},
41+
methods: {
42+
_getWebhookId() {
43+
return this.db.get("webhookId");
44+
},
45+
_setWebhookId(webhookId) {
46+
this.db.set("webhookId", webhookId);
47+
},
48+
getWebhookData() {
49+
throw new ConfigurationError("getWebhookData is not implemented");
50+
},
51+
generateMeta() {
52+
throw new ConfigurationError("generateMeta is not implemented");
53+
},
54+
},
55+
async run(event) {
56+
const { body } = event;
57+
58+
if (!body) {
59+
return;
60+
}
61+
62+
const meta = this.generateMeta(body);
63+
this.$emit(body, meta);
64+
},
65+
};
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import common from "../common/base-webhook.mjs";
2+
import sampleEmit from "./test-event.mjs";
3+
4+
export default {
5+
...common,
6+
key: "fathom-new-recording",
7+
name: "New Recording (Instant)",
8+
description: "Emit new event when a new recording is created. [See the documentation](https://developers.fathom.ai/api-reference/webhooks/create-a-webhook)",
9+
version: "0.0.1",
10+
type: "source",
11+
dedupe: "unique",
12+
props: {
13+
...common.props,
14+
triggeredFor: {
15+
type: "string[]",
16+
label: "Triggered For",
17+
description: "The types of recordings to trigger the webhook",
18+
options: [
19+
"my_recordings",
20+
"shared_external_recordings",
21+
"my_shared_with_team_recordings",
22+
"shared_team_recordings",
23+
],
24+
},
25+
},
26+
methods: {
27+
...common.methods,
28+
getWebhookData() {
29+
return {
30+
triggered_for: this.triggeredFor,
31+
include_action_items: this.include.includes("action_items"),
32+
include_crm_matches: this.include.includes("crm_matches"),
33+
include_summary: this.include.includes("summary"),
34+
include_transcript: this.include.includes("transcript"),
35+
};
36+
},
37+
generateMeta(event) {
38+
return {
39+
id: event.recording_id,
40+
summary: `New recording: ${event.recording_id}`,
41+
ts: Date.now(),
42+
};
43+
},
44+
},
45+
sampleEmit,
46+
};

0 commit comments

Comments
 (0)