-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
fix: Actions parity in TS SDK #991
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
46072fb
added 10mb max buffer size
plxity 3b3fec1
ran prettier
plxity 3872ed9
fixed action cli in TS
plxity b3804c9
fixed action cli in TS
plxity e899b48
Merge branch 'master' of https://github.com/ComposioHQ/composio into …
plxity afb4e26
fixed action cli in TS
plxity bde0b4a
Merge branch 'master' into fix-cli-parity-3
plxity 9e0b2fd
fixed action cli in TS
plxity f88ccd6
Merge branch 'fix-cli-parity-3' of https://github.com/ComposioHQ/comp…
plxity 1ccdf0d
fixed action cli in TS
plxity 1196135
fixed action cli in TS
plxity 8d890c9
fixed action cli in TS
plxity 5e81f83
Merge branch 'master' into fix-cli-parity-3
plxity cd42f57
Merge branch 'master' into fix-cli-parity-3
plxity a0adee3
Merge branch 'master' into fix-cli-parity-3
plxity 7ac89f3
Merge branch 'master' into fix-cli-parity-3
plxity 854f095
Merge branch 'master' into fix-cli-parity-3
plxity 4002cc7
fixed action cli in TS
plxity 0145807
Merge branch 'master' into fix-cli-parity-3
plxity c94337b
fixed actions cli
plxity a25004e
fixed actions cli
plxity 2aa2d18
Merge branch 'master' into fix-cli-parity-3
plxity 4f575b3
changed max warning
plxity 02dd841
Merge branch 'fix-cli-parity-3' of https://github.com/ComposioHQ/comp…
plxity 02c31ec
changed max warning
plxity 1c6cb24
fixed prettier
plxity 0a30bf7
changed workflow
plxity File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import chalk from "chalk"; | ||
import { Command } from "commander"; | ||
import client from "../sdk/client/client"; | ||
import { getOpenAPIClient } from "../sdk/utils/config"; | ||
import { ListActionsV2Data } from "../sdk/client"; | ||
|
||
export default class ActionCommand { | ||
private program: Command; | ||
|
||
constructor(program: Command) { | ||
this.program = program; | ||
this.program | ||
.command("actions") | ||
.description("Composio Actions") | ||
.option( | ||
"-a, --apps <appName>", | ||
"List all actions for the given apps", | ||
(value, previous: string[]) => previous.concat([value]), | ||
[] | ||
) | ||
.option( | ||
"--tags <tagName>", | ||
"List all actions for the given tags", | ||
(value, previous: string[]) => previous.concat([value]), | ||
[] | ||
) | ||
.option( | ||
"--use-case <useCase>", | ||
"Search for actions based on the given use case" | ||
) | ||
.option("--limit <limit>", "Limit the number of actions to display") | ||
.option("--enabled", "Only show enabled actions") | ||
.action(this.handleAction.bind(this)); | ||
} | ||
|
||
private async handleAction(options: { | ||
apps?: string[]; | ||
tags?: string[]; | ||
useCase?: string; | ||
limit?: number; | ||
enabled?: boolean; | ||
}): Promise<void> { | ||
getOpenAPIClient(); | ||
const { apps = [], tags = [], useCase, limit, enabled } = options; | ||
if (apps.length === 0) { | ||
console.log(chalk.red("Please provide at least one app name")); | ||
return; | ||
} | ||
const data: ListActionsV2Data = { | ||
query: { | ||
apps: apps.join(","), | ||
...(tags.length && { tags: tags.join(",") }), | ||
...(limit && { limit }), | ||
...(enabled && { showEnabledOnly: enabled }), | ||
...(useCase && { useCase }), | ||
}, | ||
}; | ||
try { | ||
const response = await client.actionsV2.listActionsV2(data); | ||
if (response.data?.items.length === 0) { | ||
console.log(chalk.yellow("No actions found")); | ||
return; | ||
} | ||
console.log(chalk.green("Here are the actions for the app:")); | ||
console.log(""); | ||
// render list | ||
const actions = response.data?.items || []; | ||
actions.forEach((action) => console.log(action.name)); | ||
} catch (error) { | ||
console.log(chalk.red((error as Error)?.message)); | ||
return; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Consider enhancing the action list output to include more useful information like
displayName
andenabled
status. Current output only shows the action name.