-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Fathom - new components #18766
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
Fathom - new components #18766
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
components/fathom/actions/get-recording-summary/get-recording-summary.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | ||
| }, | ||
| }; |
31 changes: 31 additions & 0 deletions
31
components/fathom/actions/get-recording-transcript/get-recording-transcript.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | ||
| }, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | ||
| }, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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, | ||
| }); | ||
| }, | ||
| }, | ||
| }; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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": [ | ||
|
|
@@ -11,5 +11,8 @@ | |
| "author": "Pipedream <[email protected]> (https://pipedream.com/)", | ||
| "publishConfig": { | ||
| "access": "public" | ||
| }, | ||
| "dependencies": { | ||
| "@pipedream/platform": "^3.1.0" | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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", | ||
| ], | ||
| }, | ||
michelle0927 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| }, | ||
| 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); | ||
| }, | ||
| }; | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.