Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Mirrored from https://github.com/Camo67/composio.git
Synced Nov 21, 06:00 UTC
| 1 | import { Argument, Command, Flag } from 'effect/cli'; |
| 2 | import { runLogsTriggers } from './logs.triggers.handler'; |
| 3 | |
| 4 | const cursor = Flag.String('cursor').pipe( |
| 5 | Flag.withDescription('Cursor for pagination'), |
| 6 | Flag.optional |
| 7 | ); |
| 8 | |
| 9 | // Declared for its help row, which documents the comma-separated filter in place of the `dev` |
| 10 | // group's shared row. The parser hands every `--user-id` under `dev` to the shared flag, so |
| 11 | // the value is read from `CommandSurface`. |
| 12 | const userId = Flag.String('user-id').pipe( |
| 13 | Flag.withDescription('Filter by user id'), |
| 14 | Flag.optional |
| 15 | ); |
| 16 | |
| 17 | const connectedAccountId = Flag.String('connected-account-id').pipe( |
| 18 | Flag.withDescription('Filter by connected account id'), |
| 19 | Flag.optional |
| 20 | ); |
| 21 | |
| 22 | const trigger = Flag.String('trigger').pipe( |
| 23 | Flag.withDescription('Filter by trigger name'), |
| 24 | Flag.optional |
| 25 | ); |
| 26 | |
| 27 | const triggerId = Flag.String('trigger-id').pipe( |
| 28 | Flag.withDescription('Filter by trigger id'), |
| 29 | Flag.optional |
| 30 | ); |
| 31 | |
| 32 | const logIdFilter = Flag.String('log-id').pipe( |
| 33 | Flag.withDescription('Filter by log id'), |
| 34 | Flag.optional |
| 35 | ); |
| 36 | |
| 37 | const logId = Argument.String('log_id').pipe( |
| 38 | Argument.withDescription('Trigger log ID'), |
| 39 | Argument.optional |
| 40 | ); |
| 41 | |
| 42 | const from = Flag.Int('from').pipe( |
| 43 | Flag.withDescription('Start timestamp (epoch milliseconds)'), |
| 44 | Flag.optional |
| 45 | ); |
| 46 | |
| 47 | const to = Flag.Int('to').pipe( |
| 48 | Flag.withDescription('End timestamp (epoch milliseconds)'), |
| 49 | Flag.optional |
| 50 | ); |
| 51 | |
| 52 | const limit = Flag.Int('limit').pipe( |
| 53 | Flag.withDefault(30), |
| 54 | Flag.withDescription('Number of logs to fetch (1-1000)') |
| 55 | ); |
| 56 | |
| 57 | const time = Flag.Literals('time', ['5m', '30m', '6h', '1d', '1w', '1month', '1y'] as const).pipe( |
| 58 | Flag.optional, |
| 59 | Flag.withDescription('Show logs from a relative time window') |
| 60 | ); |
| 61 | |
| 62 | const search = Flag.String('search').pipe( |
| 63 | Flag.withDescription('Full-text search query'), |
| 64 | Flag.optional |
| 65 | ); |
| 66 | |
| 67 | const includePayload = Flag.Boolean('include-payload').pipe( |
| 68 | Flag.withDefault(false), |
| 69 | Flag.withDescription('Include payload fields in response') |
| 70 | ); |
| 71 | |
| 72 | export const logsCmd$Triggers = Command.make( |
| 73 | 'triggers', |
| 74 | { |
| 75 | logId, |
| 76 | cursor, |
| 77 | userId, |
| 78 | connectedAccountId, |
| 79 | trigger, |
| 80 | triggerId, |
| 81 | logIdFilter, |
| 82 | from, |
| 83 | to, |
| 84 | limit, |
| 85 | time, |
| 86 | search, |
| 87 | includePayload, |
| 88 | }, |
| 89 | runLogsTriggers |
| 90 | ).pipe(Command.withDescription('List trigger logs.')); |