Skip to content

Commit a95859c

Browse files
committed
[Components] flash_by_velora_ai
1 parent 31906cf commit a95859c

File tree

5 files changed

+220
-8
lines changed

5 files changed

+220
-8
lines changed
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
import app from "../../flash_by_velora_ai.app.mjs";
2+
3+
export default {
4+
key: "flash_by_velora_ai-add-feedback",
5+
name: "Add Feedback",
6+
description: "Adds customer feedback.",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
app,
11+
feedback: {
12+
type: "string",
13+
label: "Feedback",
14+
description: "Actual text customer feedback.",
15+
},
16+
title: {
17+
type: "string",
18+
label: "Title",
19+
description: "Title of the customer feedback, if any.",
20+
optional: true,
21+
},
22+
source: {
23+
type: "string",
24+
label: "Source",
25+
description: "Source where the feedback was received, for example, `GitHub`, `Slack`, etc.",
26+
optional: true,
27+
},
28+
upvote: {
29+
type: "integer",
30+
label: "Upvote",
31+
description: "Count of upvotes for the feedback.",
32+
optional: true,
33+
},
34+
downvote: {
35+
type: "integer",
36+
label: "Downvote",
37+
description: "Count of downvotes for the feedback.",
38+
optional: true,
39+
},
40+
contactName: {
41+
type: "string",
42+
label: "Contact Name",
43+
description: "Name of the customer contact who provided the feedback.",
44+
optional: true,
45+
},
46+
contactEmail: {
47+
type: "string",
48+
label: "Contact Email",
49+
description: "Email of the customer contact who provided the feedback.",
50+
optional: true,
51+
},
52+
handle: {
53+
type: "string",
54+
label: "Handle",
55+
description: "Platform specific customer contact handle. Eg. `@pipedream`.",
56+
optional: true,
57+
},
58+
handleType: {
59+
type: "string",
60+
label: "Handle Type",
61+
description: "Platform which the contact handle belongs to. Eg. `Twitter`, `GitHub`, etc.",
62+
optional: true,
63+
},
64+
companyName: {
65+
type: "string",
66+
label: "Company Name",
67+
description: "Name of customer company to which the customer contact who provided feedback belongs.",
68+
optional: true,
69+
},
70+
companyDomain: {
71+
type: "string",
72+
label: "Company Domain",
73+
description: "Email domain of customer company to which the customer contact who provided feedback belongs. Eg. `pipedream.com`.",
74+
optional: true,
75+
},
76+
feedbackAt: {
77+
type: "string",
78+
label: "Feedback At",
79+
description: "Date and time, when the feedback was received. Eg. `2021-01-01T00:00:00`.",
80+
optional: true,
81+
},
82+
},
83+
methods: {
84+
addFeedback(args = {}) {
85+
return this.app.post({
86+
path: "/add-feedback",
87+
...args,
88+
});
89+
},
90+
},
91+
async run({ $ }) {
92+
const {
93+
addFeedback,
94+
feedback,
95+
title,
96+
source,
97+
upvote,
98+
downvote,
99+
contactName,
100+
contactEmail,
101+
handle,
102+
handleType,
103+
companyName,
104+
companyDomain,
105+
feedbackAt,
106+
} = this;
107+
108+
const response = await addFeedback({
109+
$,
110+
data: {
111+
feedback,
112+
title,
113+
source,
114+
upvote,
115+
downvote,
116+
contact_name: contactName,
117+
contact_email: contactEmail,
118+
handle,
119+
handle_type: handleType,
120+
company_name: companyName,
121+
company_domain: companyDomain,
122+
feedback_at: feedbackAt,
123+
},
124+
});
125+
$.export("$summary", "Succesfully added feedback.");
126+
return response;
127+
},
128+
};
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import app from "../../flash_by_velora_ai.app.mjs";
2+
3+
export default {
4+
key: "flash_by_velora_ai-upload-transcript",
5+
name: "Upload Transcript",
6+
description: "Upload a meeting transcript.",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
app,
11+
title: {
12+
type: "string",
13+
label: "Meeting Title",
14+
description: "Title of the meeting.",
15+
},
16+
fileUrl: {
17+
type: "string",
18+
label: "File URL",
19+
description: "Transcript file (supported types: **text/plain**, **pdf**, **vtt**) or transcript text.",
20+
},
21+
sourceType: {
22+
type: "string",
23+
label: "Source Type",
24+
description: "Type of the source system of the file, for example, `Google Drive`, `Fireflies.ai`, etc.",
25+
},
26+
},
27+
methods: {
28+
uploadTranscript(args = {}) {
29+
return this.app.post({
30+
path: "/upload-transcript",
31+
...args,
32+
});
33+
},
34+
},
35+
async run({ $ }) {
36+
const {
37+
uploadTranscript,
38+
title,
39+
fileUrl,
40+
sourceType,
41+
} = this;
42+
43+
const response = await uploadTranscript({
44+
$,
45+
data: {
46+
title,
47+
file_url: fileUrl,
48+
source_type: sourceType,
49+
},
50+
});
51+
52+
$.export("$summary", "Succesfully uploaded transcript.");
53+
return response;
54+
},
55+
};
Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,34 @@
1+
import { axios } from "@pipedream/platform";
2+
13
export default {
24
type: "app",
35
app: "flash_by_velora_ai",
4-
propDefinitions: {},
56
methods: {
6-
// this.$auth contains connected account data
7-
authKeys() {
8-
console.log(Object.keys(this.$auth));
7+
getUrl(path) {
8+
return `https://flash-api.velora.ai/v1/api${path}`;
9+
},
10+
getHeaders(headers) {
11+
return {
12+
...headers,
13+
"Content-Type": "application/json",
14+
"Accept": "application/json",
15+
"x-api-key": this.$auth.api_key,
16+
};
17+
},
18+
_makeRequest({
19+
$ = this, path, headers, ...args
20+
} = {}) {
21+
return axios($, {
22+
...args,
23+
url: this.getUrl(path),
24+
headers: this.getHeaders(headers),
25+
});
26+
},
27+
post(args = {}) {
28+
return this._makeRequest({
29+
method: "POST",
30+
...args,
31+
});
932
},
1033
},
11-
};
34+
};

components/flash_by_velora_ai/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/flash_by_velora_ai",
3-
"version": "0.0.1",
3+
"version": "0.1.0",
44
"description": "Pipedream Flash (by Velora AI) Components",
55
"main": "flash_by_velora_ai.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.0.3"
1417
}
15-
}
18+
}

pnpm-lock.yaml

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

0 commit comments

Comments
 (0)