Skip to content

Commit 00f6b49

Browse files
[Components] finnhub #10909 (#19105)
* Added actions * Added actions * fix typos --------- Co-authored-by: Michelle Bergeron <michelle.bergeron@gmail.com>
1 parent f891b6f commit 00f6b49

File tree

7 files changed

+575
-6
lines changed

7 files changed

+575
-6
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import app from "../../finnhub.app.mjs";
2+
3+
export default {
4+
key: "finnhub-get-insider-transactions",
5+
name: "Get Insider Transactions",
6+
description: "Get a list of insider transactions from a specified time period. [See the documentation](https://finnhub.io/docs/api/insider-transactions)",
7+
version: "0.0.1",
8+
annotations: {
9+
destructiveHint: false,
10+
openWorldHint: true,
11+
readOnlyHint: true,
12+
},
13+
type: "action",
14+
props: {
15+
app,
16+
symbol: {
17+
propDefinition: [
18+
app,
19+
"symbol",
20+
],
21+
},
22+
from: {
23+
propDefinition: [
24+
app,
25+
"from",
26+
],
27+
},
28+
to: {
29+
propDefinition: [
30+
app,
31+
"to",
32+
],
33+
},
34+
},
35+
async run({ $ }) {
36+
const response = await this.app.getInsiderTransactions({
37+
$,
38+
params: {
39+
symbol: this.symbol,
40+
from: this.from,
41+
to: this.to,
42+
},
43+
});
44+
$.export("$summary", "Successfully retrieved " + response.data.length + " transactions");
45+
return response;
46+
},
47+
};
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import app from "../../finnhub.app.mjs";
2+
3+
export default {
4+
key: "finnhub-get-market-news",
5+
name: "Get Market News",
6+
description: "Get a list of the latest market news. [See the documentation](https://finnhub.io/docs/api/market-news)",
7+
version: "0.0.1",
8+
annotations: {
9+
destructiveHint: false,
10+
openWorldHint: true,
11+
readOnlyHint: true,
12+
},
13+
type: "action",
14+
props: {
15+
app,
16+
category: {
17+
propDefinition: [
18+
app,
19+
"category",
20+
],
21+
},
22+
},
23+
async run({ $ }) {
24+
const response = await this.app.getMarketNews({
25+
$,
26+
data: {
27+
category: this.category,
28+
},
29+
});
30+
$.export("$summary", "Successfully retrieved " + response.length + " market news");
31+
return response;
32+
},
33+
};
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import app from "../../finnhub.app.mjs";
2+
3+
export default {
4+
key: "finnhub-get-recommendation-trends",
5+
name: "Get Recommendation Trends",
6+
description: "Get latest analyst recommendation trends for a company. [See the documentation](https://finnhub.io/docs/api/recommendation-trends)",
7+
version: "0.0.1",
8+
annotations: {
9+
destructiveHint: false,
10+
openWorldHint: true,
11+
readOnlyHint: true,
12+
},
13+
type: "action",
14+
props: {
15+
app,
16+
symbol: {
17+
propDefinition: [
18+
app,
19+
"symbol",
20+
],
21+
},
22+
},
23+
async run({ $ }) {
24+
const response = await this.app.getRecommendationTrends({
25+
$,
26+
params: {
27+
symbol: this.symbol,
28+
},
29+
});
30+
$.export("$summary", "Successfully retrieved " + response.length + " recommendation trends");
31+
return response;
32+
},
33+
};
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import app from "../../finnhub.app.mjs";
2+
3+
export default {
4+
key: "finnhub-get-symbols",
5+
name: "Get Symbols",
6+
description: "Get a list of supported stock symbols. [See the documentation](https://finnhub.io/docs/api/stock-symbols)",
7+
version: "0.0.1",
8+
annotations: {
9+
destructiveHint: false,
10+
openWorldHint: true,
11+
readOnlyHint: true,
12+
},
13+
type: "action",
14+
props: {
15+
app,
16+
exchange: {
17+
propDefinition: [
18+
app,
19+
"exchange",
20+
],
21+
},
22+
currency: {
23+
propDefinition: [
24+
app,
25+
"currency",
26+
],
27+
},
28+
mic: {
29+
propDefinition: [
30+
app,
31+
"mic",
32+
],
33+
},
34+
},
35+
async run({ $ }) {
36+
const response = await this.app.getSymbols({
37+
$,
38+
params: {
39+
exchange: this.exchange,
40+
currency: this.currency,
41+
mic: this.mic,
42+
},
43+
});
44+
$.export("$summary", "Successfully retrieved " + response.length + " symbols");
45+
return response;
46+
},
47+
};

0 commit comments

Comments
 (0)