Skip to content

Commit b7a74a5

Browse files
committed
new components
1 parent 311d74e commit b7a74a5

File tree

8 files changed

+425
-7
lines changed

8 files changed

+425
-7
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: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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: "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+
include_summary: this.includeSummary,
54+
include_transcript: this.includeTranscript,
55+
created_after: this.createdAfter,
56+
created_before: this.createdBefore,
57+
cursor: this.cursor,
58+
},
59+
});
60+
$.export("$summary", `Successfully listed ${response?.items?.length} meetings`);
61+
return response;
62+
},
63+
};

components/fathom/fathom.app.mjs

Lines changed: 107 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,113 @@
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+
includeSummary: {
45+
type: "boolean",
46+
label: "Include Summary",
47+
description: "Include the summary for each meeting",
48+
optional: true,
49+
},
50+
includeTranscript: {
51+
type: "boolean",
52+
label: "Include Transcript",
53+
description: "Include the transcript for each meeting",
54+
optional: true,
55+
},
56+
},
557
methods: {
6-
// this.$auth contains connected account data
7-
authKeys() {
8-
console.log(Object.keys(this.$auth));
58+
_baseUrl() {
59+
return "https://api.fathom.ai/external/v1";
60+
},
61+
_makeRequest({
62+
$ = this,
63+
path,
64+
...opts
65+
}) {
66+
return axios($, {
67+
url: `${this._baseUrl()}${path}`,
68+
headers: {
69+
Authorization: `Bearer ${this.$auth.oauth_access_token}`,
70+
},
71+
...opts,
72+
});
73+
},
74+
createWebhook(opts = {}) {
75+
return this._makeRequest({
76+
path: "/webhooks",
77+
method: "POST",
78+
...opts,
79+
});
80+
},
81+
deleteWebhook({
82+
webhookId, ...opts
83+
}) {
84+
return this._makeRequest({
85+
path: `/webhooks/${webhookId}`,
86+
method: "DELETE",
87+
...opts,
88+
});
89+
},
90+
listMeetings(opts = {}) {
91+
return this._makeRequest({
92+
path: "/meetings",
93+
...opts,
94+
});
95+
},
96+
getRecordingSummary({
97+
recordingId, ...opts
98+
}) {
99+
return this._makeRequest({
100+
path: `/recordings/${recordingId}/summary`,
101+
...opts,
102+
});
103+
},
104+
getRecordingTranscript({
105+
recordingId, ...opts
106+
}) {
107+
return this._makeRequest({
108+
path: `/recordings/${recordingId}/transcript`,
109+
...opts,
110+
});
9111
},
10112
},
11-
};
113+
};

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: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
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+
includeActionItems: {
10+
propDefinition: [
11+
fathom,
12+
"includeActionItems",
13+
],
14+
},
15+
includeCrmMatches: {
16+
propDefinition: [
17+
fathom,
18+
"includeCrmMatches",
19+
],
20+
},
21+
includeSummary: {
22+
propDefinition: [
23+
fathom,
24+
"includeSummary",
25+
],
26+
},
27+
includeTranscript: {
28+
propDefinition: [
29+
fathom,
30+
"includeTranscript",
31+
],
32+
},
33+
},
34+
hooks: {
35+
async activate() {
36+
if (
37+
!this.includeTranscript
38+
&& !this.includeSummary
39+
&& !this.includeCrmMatches
40+
&& !this.includeActionItems)
41+
{
42+
throw new ConfigurationError("At least one of includeTranscript, includeSummary, includeCrmMatches, or includeActionItems must be true");
43+
}
44+
45+
const { id } = await this.fathom.createWebhook({
46+
data: {
47+
destination_url: this.http.endpoint,
48+
...this.getWebhookData(),
49+
},
50+
});
51+
52+
this._setWebhookId(id);
53+
},
54+
async deactivate() {
55+
const webhookId = this._getWebhookId();
56+
if (webhookId) {
57+
await this.fathom.deleteWebhook({
58+
webhookId,
59+
});
60+
}
61+
},
62+
},
63+
methods: {
64+
_getWebhookId() {
65+
return this.db.get("webhookId");
66+
},
67+
_setWebhookId(webhookId) {
68+
this.db.set("webhookId", webhookId);
69+
},
70+
getWebhookData() {
71+
throw new ConfigurationError("getWebhookData is not implemented");
72+
},
73+
generateMeta() {
74+
throw new ConfigurationError("generateMeta is not implemented");
75+
},
76+
},
77+
async run(event) {
78+
const { body } = event;
79+
80+
if (!body) {
81+
return;
82+
}
83+
84+
const meta = this.generateMeta(body);
85+
this.$emit(body, meta);
86+
},
87+
};

0 commit comments

Comments
 (0)