-
Notifications
You must be signed in to change notification settings - Fork 5.5k
[Components] finnhub #10909 #19105
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
base: master
Are you sure you want to change the base?
[Components] finnhub #10909 #19105
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| import app from "../../finnhub.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "finnhub-get-insider-transactions", | ||
| name: "Get Insider Transactions", | ||
| description: "Get a list os insider transactions from a specified time period. [See the documentation](https://finnhub.io/docs/api/insider-transactions)", | ||
| version: "0.0.1", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| }, | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| symbol: { | ||
| propDefinition: [ | ||
| app, | ||
| "symbol", | ||
| ], | ||
| }, | ||
| from: { | ||
| propDefinition: [ | ||
| app, | ||
| "from", | ||
| ], | ||
| }, | ||
| to: { | ||
| propDefinition: [ | ||
| app, | ||
| "to", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.app.getInsiderTransactions({ | ||
| $, | ||
| params: { | ||
| symbol: this.symbol, | ||
| from: this.from, | ||
| to: this.to, | ||
| }, | ||
| }); | ||
| $.export("$summary", "Successfully retrieved " + response.data.length + " transactions"); | ||
| return response; | ||
| }, | ||
| }; | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,33 @@ | ||||||
| import app from "../../finnhub.app.mjs"; | ||||||
|
|
||||||
| export default { | ||||||
| key: "finnhub-get-market-news", | ||||||
| name: "Get Market News", | ||||||
| description: "Get a list of the latest market news. [See the documentation](https://finnhub.io/docs/api/market-news)", | ||||||
| version: "0.0.1", | ||||||
| annotations: { | ||||||
| destructiveHint: false, | ||||||
| openWorldHint: true, | ||||||
| readOnlyHint: true, | ||||||
| }, | ||||||
| type: "action", | ||||||
| props: { | ||||||
| app, | ||||||
| category: { | ||||||
| propDefinition: [ | ||||||
| app, | ||||||
| "category", | ||||||
| ], | ||||||
| }, | ||||||
| }, | ||||||
| async run({ $ }) { | ||||||
| const response = await this.app.getMarketNews({ | ||||||
| $, | ||||||
| data: { | ||||||
| category: this.category, | ||||||
| }, | ||||||
| }); | ||||||
|
Comment on lines
+24
to
+29
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chainVerify parameter passing pattern. This action uses Run this script to check the API documentation pattern: 🏁 Script executed: #!/bin/bash
# Check how parameters are passed in other action files
echo "=== Checking parameter passing patterns ==="
rg -A5 "await this\.app\." components/finnhub/actions/Length of output: 2326 I need to verify if this parameter passing difference is intentional by checking how the app methods are implemented. Additionally, let me check the Finnhub API documentation context: Length of output: 83 🏁 Script executed: #!/bin/bash
# Look for where these methods are defined
echo "=== Searching for method definitions ==="
rg -n "getMarketNews|getSymbols|getInsiderTransactions" --type mjs -B2 -A10 | grep -E "(^[^-]|function|async|params|data)" | head -50Length of output: 68 🌐 Web query: 💡 Result: Summary — GET /api/v1/news parameters
Example request: Sources: [1] Finnhub API docs / client library reference (market_news: category, minId). [2] Finnhub examples showing /news usage. Length of output: 618 Length of output: 957 Change The 🤖 Prompt for AI Agents |
||||||
| $.export("$summary", "Successfully retrieved " + response.length + " market news"); | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Use template literal for summary message. For consistency with best practices, use a template literal instead of string concatenation. Apply this diff: - $.export("$summary", "Successfully retrieved " + response.length + " market news");
+ $.export("$summary", `Successfully retrieved ${response.length} market news`);Based on learnings. 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| return response; | ||||||
| }, | ||||||
| }; | ||||||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,33 @@ | ||||||||||
| import app from "../../finnhub.app.mjs"; | ||||||||||
|
|
||||||||||
| export default { | ||||||||||
| key: "finnhub-get-recommentadion-trends", | ||||||||||
| name: "Get Recommentadion Trends", | ||||||||||
|
Comment on lines
+4
to
+5
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix typo in action key and name. "Recommentadion" should be "Recommendation" throughout. This affects the action key (line 4), name (line 5), the method call (line 24), and ideally the filename and directory name. Apply this diff: - key: "finnhub-get-recommentadion-trends",
- name: "Get Recommentadion Trends",
+ key: "finnhub-get-recommendation-trends",
+ name: "Get Recommendation Trends",Also update the method call on line 24: - const response = await this.app.getRecommentadionTrends({
+ const response = await this.app.getRecommendationTrends({And rename the directory from 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix the typo here |
||||||||||
| description: "Get latest analyst recommendation trends for a company. [See the documentation](https://finnhub.io/docs/api/recommendation-trends)", | ||||||||||
| version: "0.0.1", | ||||||||||
| annotations: { | ||||||||||
| destructiveHint: false, | ||||||||||
| openWorldHint: true, | ||||||||||
| readOnlyHint: true, | ||||||||||
| }, | ||||||||||
| type: "action", | ||||||||||
| props: { | ||||||||||
| app, | ||||||||||
| symbol: { | ||||||||||
| propDefinition: [ | ||||||||||
| app, | ||||||||||
| "symbol", | ||||||||||
| ], | ||||||||||
| }, | ||||||||||
| }, | ||||||||||
| async run({ $ }) { | ||||||||||
| const response = await this.app.getRecommentadionTrends({ | ||||||||||
| $, | ||||||||||
| params: { | ||||||||||
| symbol: this.symbol, | ||||||||||
| }, | ||||||||||
| }); | ||||||||||
| $.export("$summary", "Successfully retrieved " + response.length + " recommendation trends"); | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Use template literal for summary message. For consistency with best practices, use a template literal instead of string concatenation. Apply this diff: - $.export("$summary", "Successfully retrieved " + response.length + " recommendation trends");
+ $.export("$summary", `Successfully retrieved ${response.length} recommendation trends`);Based on learnings. 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||
| return response; | ||||||||||
| }, | ||||||||||
| }; | ||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,47 @@ | ||||||
| import app from "../../finnhub.app.mjs"; | ||||||
|
|
||||||
| export default { | ||||||
| key: "finnhub-get-symbols", | ||||||
| name: "Get Symbols", | ||||||
| description: "Get a list of supported stock symbols. [See the documentation](https://finnhub.io/docs/api/stock-symbols)", | ||||||
| version: "0.0.1", | ||||||
| annotations: { | ||||||
| destructiveHint: false, | ||||||
| openWorldHint: true, | ||||||
| readOnlyHint: true, | ||||||
| }, | ||||||
| type: "action", | ||||||
| props: { | ||||||
| app, | ||||||
| exchange: { | ||||||
| propDefinition: [ | ||||||
| app, | ||||||
| "exchange", | ||||||
| ], | ||||||
| }, | ||||||
| currency: { | ||||||
| propDefinition: [ | ||||||
| app, | ||||||
| "currency", | ||||||
| ], | ||||||
| }, | ||||||
| mic: { | ||||||
| propDefinition: [ | ||||||
| app, | ||||||
| "mic", | ||||||
| ], | ||||||
| }, | ||||||
| }, | ||||||
| async run({ $ }) { | ||||||
| const response = await this.app.getSymbols({ | ||||||
| $, | ||||||
| params: { | ||||||
| exchange: this.exchange, | ||||||
| currency: this.currency, | ||||||
| mic: this.mic, | ||||||
| }, | ||||||
| }); | ||||||
| $.export("$summary", "Successfully retrieved " + response.length + " symbols"); | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Use template literal for summary message. For consistency with best practices, use a template literal instead of string concatenation. Apply this diff: - $.export("$summary", "Successfully retrieved " + response.length + " symbols");
+ $.export("$summary", `Successfully retrieved ${response.length} symbols`);Based on learnings. 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| return response; | ||||||
| }, | ||||||
| }; | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix typo in description.
"Get a list os insider transactions" should be "Get a list of insider transactions".
Apply this diff:
📝 Committable suggestion
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a good suggestion