Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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,11 @@ export default {
},
},
});

if (meeting.errors?.length) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, minor coding style nit here, but rather than requiring all callers of proxy handle these errors, which can be error prone, it might be more consistent to have the base function detect an error response (e.g. by finding an error key in the json response), and raising the ConfigurationError at that point. That way upload-audio any future actions, as well as async options can all benefit from the same error handling. Does that make sense?

throw new ConfigurationError(`Error: ${meeting.errors[0].message}`);
}

$.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,12 @@ export default {
},
},
});

if (user.errors?.length) {
throw new ConfigurationError(`Error: ${user.errors[0].message}`);
}

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 +50,11 @@ export default {
},
},
});

if (meeting.errors?.length) {
throw new ConfigurationError(`Error: ${meeting.errors[0].message}`);
}

$.export("$summary", `Successfully fetched the most recent meeting for user with ID ${this.userId}`);
return meeting;
},
Expand Down
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"
}
}
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