Skip to content

Commit eb127e5

Browse files
authored
Fireflies - error handling (#16024)
* improve error handling * pnpm-lock.yaml * update * move ConfigurationError to query method * versions
1 parent d0e0356 commit eb127e5

File tree

7 files changed

+32
-12
lines changed

7 files changed

+32
-12
lines changed

components/fireflies/actions/find-meeting-by-id/find-meeting-by-id.mjs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import fireflies from "../../fireflies.app.mjs";
22
import queries from "../../common/queries.mjs";
3+
import { ConfigurationError } from "@pipedream/platform";
34

45
export default {
56
key: "fireflies-find-meeting-by-id",
67
name: "Find Meeting by ID",
78
description: "Locates a specific user meeting by its unique ID. [See the documentation](https://docs.fireflies.ai/graphql-api/query/transcript)",
8-
version: "0.0.1",
9+
version: "0.0.2",
910
type: "action",
1011
props: {
1112
fireflies,
@@ -17,6 +18,10 @@ export default {
1718
},
1819
},
1920
async run({ $ }) {
21+
if (!this.meetingId) {
22+
throw new ConfigurationError("Meeting ID is required");
23+
}
24+
2025
const meeting = await this.fireflies.query({
2126
$,
2227
data: {
@@ -26,6 +31,7 @@ export default {
2631
},
2732
},
2833
});
34+
2935
$.export("$summary", `Successfully found meeting with ID: ${this.meetingId}`);
3036
return meeting;
3137
},

components/fireflies/actions/find-recent-meeting/find-recent-meeting.mjs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import fireflies from "../../fireflies.app.mjs";
22
import queries from "../../common/queries.mjs";
3+
import { ConfigurationError } from "@pipedream/platform";
34

45
export default {
56
key: "fireflies-find-recent-meeting",
67
name: "Find Recent Meeting",
78
description: "Retrieves the most recent meeting for a user. [See the documentation](https://docs.fireflies.ai/graphql-api/query/user)",
8-
version: "0.0.1",
9+
version: "0.0.2",
910
type: "action",
1011
props: {
1112
fireflies,
@@ -17,7 +18,11 @@ export default {
1718
},
1819
},
1920
async run({ $ }) {
20-
const { data: { user: { recent_meeting: meetingId } } } = await this.fireflies.query({
21+
if (!this.userId) {
22+
throw new ConfigurationError("User ID is required");
23+
}
24+
25+
const user = await this.fireflies.query({
2126
$,
2227
data: {
2328
query: queries.getUser,
@@ -26,6 +31,8 @@ export default {
2631
},
2732
},
2833
});
34+
35+
const meetingId = user?.data?.user?.recent_meeting;
2936
if (!meetingId) {
3037
$.export("$summary", `No meeting found for user with ID ${this.userId}`);
3138
return;
@@ -39,6 +46,7 @@ export default {
3946
},
4047
},
4148
});
49+
4250
$.export("$summary", `Successfully fetched the most recent meeting for user with ID ${this.userId}`);
4351
return meeting;
4452
},

components/fireflies/actions/upload-audio/upload-audio.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "fireflies-upload-audio",
66
name: "Upload Audio",
77
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)",
8-
version: "0.0.1",
8+
version: "0.0.2",
99
type: "action",
1010
props: {
1111
fireflies,

components/fireflies/fireflies.app.mjs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import { axios } from "@pipedream/platform";
1+
import {
2+
axios, ConfigurationError,
3+
} from "@pipedream/platform";
24
import constants from "./common/constants.mjs";
35
import queries from "./common/queries.mjs";
46

@@ -70,11 +72,15 @@ export default {
7072
},
7173
});
7274
},
73-
query(opts = {}) {
74-
return this._makeRequest({
75+
async query(opts = {}) {
76+
const response = await this._makeRequest({
7577
method: "POST",
7678
...opts,
7779
});
80+
if (response.errors?.length) {
81+
throw new ConfigurationError(`Error: ${response.errors[0].message}`);
82+
}
83+
return response;
7884
},
7985
},
8086
};

components/fireflies/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/fireflies",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "Pipedream Fireflies Components",
55
"main": "fireflies.app.mjs",
66
"keywords": [
@@ -13,6 +13,6 @@
1313
"access": "public"
1414
},
1515
"dependencies": {
16-
"@pipedream/platform": "^1.6.2"
16+
"@pipedream/platform": "^3.0.3"
1717
}
1818
}

components/fireflies/sources/new-meeting-created/new-meeting-created.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default {
88
key: "fireflies-new-meeting-created",
99
name: "New Meeting Created",
1010
description: "Emit new event when a meeting with transcripts is created",
11-
version: "0.0.1",
11+
version: "0.0.2",
1212
type: "source",
1313
dedupe: "unique",
1414
props: {

pnpm-lock.yaml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)