-
Notifications
You must be signed in to change notification settings - Fork 55
feat: get monitors pagination #34
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
feat: get monitors pagination #34
Conversation
Signed-off-by: Dragan Pelengić <dp@MacBook-Pro.local>
Signed-off-by: Dragan Pelengic <46516779+dpelengic@users.noreply.github.com>
winor30
left a comment
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.
thank you for your contribution!
i reviewd some comments. but almost lgtm
| ...(monitors.length > 0 | ||
| ? [ | ||
| { | ||
| type: 'text', | ||
| text: `Last monitor ID: ${monitors[monitors.length - 1].id}`, | ||
| }, | ||
| ] | ||
| : []), |
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.
i think these logic can be more simplified
monitors.length > 0 && {
type: 'text',
text: `Last monitor ID:
${monitors[monitors.length - 1].id}`
}| ), | ||
| page: z | ||
| .number() | ||
| .int() |
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.
i think it is better
| .int() | |
| .int() | |
| .min(0) |
| ), | ||
| pageSize: z | ||
| .number() | ||
| .int() |
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.
| .int() | |
| .int() | |
| .positive() |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #34 +/- ##
==========================================
+ Coverage 89.66% 89.98% +0.32%
==========================================
Files 32 32
Lines 1238 1278 +40
Branches 153 155 +2
==========================================
+ Hits 1110 1150 +40
Misses 128 128 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Adds pagination capabilities to the
get_monitorstool for more efficient monitor listing and specific monitor retrieval.Changes
idOffset: Start listing from a specific monitor IDpage: Page number (0-based)pageSize: Number of monitors per page (default: 100)Use Cases
pageandpageSizeidOffsetidOffsetwithpageSize=1All changes maintain backward compatibility and follow existing test patterns.