Skip to content

Fireflies - error handling #16024

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 5 commits into from
Mar 26, 2025
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
@@ -1,11 +1,12 @@
import fireflies from "../../fireflies.app.mjs";
import queries from "../../common/queries.mjs";
import { ConfigurationError } from "@pipedream/platform";

export default {
key: "fireflies-find-meeting-by-id",
name: "Find Meeting by ID",
description: "Locates a specific user meeting by its unique ID. [See the documentation](https://docs.fireflies.ai/graphql-api/query/transcript)",
version: "0.0.1",
version: "0.0.2",
type: "action",
props: {
fireflies,
Expand All @@ -17,6 +18,10 @@ export default {
},
},
async run({ $ }) {
if (!this.meetingId) {
throw new ConfigurationError("Meeting ID is required");
}

const meeting = await this.fireflies.query({
$,
data: {
Expand All @@ -26,6 +31,7 @@ export default {
},
},
});

$.export("$summary", `Successfully found meeting with ID: ${this.meetingId}`);
return meeting;
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import fireflies from "../../fireflies.app.mjs";
import queries from "../../common/queries.mjs";
import { ConfigurationError } from "@pipedream/platform";

export default {
key: "fireflies-find-recent-meeting",
name: "Find Recent Meeting",
description: "Retrieves the most recent meeting for a user. [See the documentation](https://docs.fireflies.ai/graphql-api/query/user)",
version: "0.0.1",
version: "0.0.2",
type: "action",
props: {
fireflies,
Expand All @@ -17,7 +18,11 @@ export default {
},
},
async run({ $ }) {
const { data: { user: { recent_meeting: meetingId } } } = await this.fireflies.query({
if (!this.userId) {
throw new ConfigurationError("User ID is required");
}

const user = await this.fireflies.query({
$,
data: {
query: queries.getUser,
Expand All @@ -26,6 +31,8 @@ export default {
},
},
});

const meetingId = user?.data?.user?.recent_meeting;
if (!meetingId) {
$.export("$summary", `No meeting found for user with ID ${this.userId}`);
return;
Expand All @@ -39,6 +46,7 @@ export default {
},
},
});

$.export("$summary", `Successfully fetched the most recent meeting for user with ID ${this.userId}`);
return meeting;
},
Expand Down
2 changes: 1 addition & 1 deletion components/fireflies/actions/upload-audio/upload-audio.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "fireflies-upload-audio",
name: "Upload Audio",
description: "Creates and stores a new meeting in Fireflies, allowing it to be transcribed and shared. [See the documentation](https://docs.fireflies.ai/graphql-api/mutation/upload-audio)",
version: "0.0.1",
version: "0.0.2",
type: "action",
props: {
fireflies,
Expand Down
12 changes: 9 additions & 3 deletions components/fireflies/fireflies.app.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { axios } from "@pipedream/platform";
import {
axios, ConfigurationError,
} from "@pipedream/platform";
import constants from "./common/constants.mjs";
import queries from "./common/queries.mjs";

Expand Down Expand Up @@ -70,11 +72,15 @@ export default {
},
});
},
query(opts = {}) {
return this._makeRequest({
async query(opts = {}) {
const response = await this._makeRequest({
method: "POST",
...opts,
});
if (response.errors?.length) {
throw new ConfigurationError(`Error: ${response.errors[0].message}`);
}
return response;
},
},
};
4 changes: 2 additions & 2 deletions components/fireflies/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/fireflies",
"version": "0.1.0",
"version": "0.1.1",
"description": "Pipedream Fireflies Components",
"main": "fireflies.app.mjs",
"keywords": [
Expand All @@ -13,6 +13,6 @@
"access": "public"
},
"dependencies": {
"@pipedream/platform": "^1.6.2"
"@pipedream/platform": "^3.0.3"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default {
key: "fireflies-new-meeting-created",
name: "New Meeting Created",
description: "Emit new event when a meeting with transcripts is created",
version: "0.0.1",
version: "0.0.2",
type: "source",
dedupe: "unique",
props: {
Expand Down
15 changes: 7 additions & 8 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading