Document countOnly parameter and count security rule type#217
Document countOnly parameter and count security rule type#217
Conversation
- Add "Count Records Only" section to JS API docs - Add "Count Only Query" section to REST API docs - Add operation types table to security rules docs - Add 'count' case to custom security rule examples Related to DEV-859 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
WalkthroughAdds documentation for a new "count" capability for Fliplet Data Sources: a Changes
Sequence Diagram(s)(The changes are documentation-only and do not introduce new runtime control flow across multiple components; no sequence diagram is provided.) Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 Fix all issues with AI agents
In `@docs/API/fliplet-datasources.md`:
- Around line 233-271: Add required blank lines and fix list indentation in the
"### Count Records Only" section: ensure there is a blank line before and after
the "### Count Records Only" heading and a blank line before and after the ```js
fenced blocks (the examples under "#### Basic Usage"), change the "#### Security
Notes" list items to be indented with two spaces and a hyphen (e.g., " -
Requires ..."), and remove or rename the duplicate "#### Basic Usage" /
duplicate heading instance so only one unique heading remains; locate and update
the headings "### Count Records Only", "#### Basic Usage", the fenced ```js```
blocks, and "#### Security Notes" when applying these fixes.
In `@docs/Data-source-security.md`:
- Around line 40-43: Indent the markdown list items for the `type`, `user`,
`query`, and `entry` entries so they are consistently nested (e.g., two spaces
or one tab) under the preceding paragraph to satisfy MD007; update the lines
containing the backticked list items (`type`, `user`, `query`, `entry`) to use
consistent indentation spacing so markdownlint no longer flags the list.
In `@docs/REST-API/fliplet-datasources.md`:
- Line 85: Fix the grammar in the access description sentence "Data sources
requires access to be accessed to." — replace it with a corrected sentence such
as "Data sources require access to be assigned." so subject-verb agreement and
clarity are restored; leave the following sentence about roles and permissions
("Roles can have multiple permissions: **read, write, update, delete, count**.")
unchanged.
- Around line 510-512: Remove the trailing whitespace in the "Count Only Query"
section of docs/REST-API/fliplet-datasources.md (the JSON request body block
near the "Count Only Query" heading) so markdownlint no longer flags those
lines; edit the block that starts with "Request body (JSON):" and trim any
spaces at the end of lines, re-save the file, and re-run markdownlint to confirm
the warnings are resolved.
- Around line 510-535: Add the missing type field to the Count Only Query
example by including "type": "select" in the request JSON (alongside the
existing "where" and "countOnly" properties) so it matches earlier examples and
clarifies that the count-only request uses type select; update the example
request block that contains "where" and "countOnly" to include this "type"
attribute.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@docs/REST-API/fliplet-datasources.md`:
- Line 428: Indent the markdown list item for the "countOnly" entry by adding
two leading spaces so it aligns with the surrounding list formatting; locate the
line containing "-
[countOnly](https://developers.fliplet.com/API/fliplet-datasources.html#count-records-only)
- Return count without entry data" and change its indentation to match the other
list items (two spaces before the hyphen) to ensure consistent markdown list
formatting.
- Around line 531-534: The notes list currently uses no indentation which breaks
Markdown rendering; update the bullet points in the notes section so each list
item is prefixed with two spaces before the dash (e.g., " - Only
database-compatible filters...") to ensure proper nesting/formatting in
fliplet-datasources.md's notes section; keep the existing bullet text unchanged
and only add the two-space indentation for each line.
♻️ Duplicate comments (1)
docs/REST-API/fliplet-datasources.md (1)
513-519: Addtypefield for consistency with other query examples.All other query examples in this document include the
type: "select"field. Adding it here would maintain consistency and clarity.📋 Proposed update
{ + "type": "select", "where": { "SessionId": "123" }, "countOnly": true }
- Add blank line after headings before code blocks - Add blank line after Security Notes heading before list - Indent list items with 2 spaces for proper nesting Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove "database-compatible only" restriction from docs - Add Performance Notes section explaining fast path vs fallback - Simple filters use COUNT(*), complex filters use Sift.js Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@docs/REST-API/fliplet-datasources.md`:
- Around line 516-518: Remove the trailing whitespace characters in the JSON
code block—specifically trim any trailing spaces after the closing brace and
after the "countOnly": true line so the lines containing "countOnly": true and
the subsequent closing brace contain no extra spaces; update the block around
the keys/values shown in the diff (the lines with the closing brace and
"countOnly": true) to eliminate trailing whitespace and pass markdownlint.
♻️ Duplicate comments (3)
docs/REST-API/fliplet-datasources.md (3)
428-428: Fix list indentation for consistency.The list item should be indented with 2 spaces to match markdown best practices and resolve the markdownlint warning flagged in past reviews.
🧹 Proposed fix
-- [countOnly](https://developers.fliplet.com/API/fliplet-datasources.html#count-records-only) - Return count without entry data + - [countOnly](https://developers.fliplet.com/API/fliplet-datasources.html#count-records-only) - Return count without entry data
512-519: Includetypefield in the Count Only Query example for consistency.The basic query example (lines 434-441) includes
"type": "select", but this count-only example omits it. Adding the field clarifies that count queries are select operations and maintains consistency across examples.📝 Proposed fix
```json { + "type": "select", "where": { "SessionId": "123" }, "countOnly": true }</details> --- `530-534`: **Fix list indentation in the Notes section.** The bullet points should be indented with 2 spaces for proper markdown formatting, consistent with past review feedback and markdownlint requirements. <details> <summary>🧹 Proposed fix</summary> ```diff **Notes:** -- Requires `count` or `select` permission in security rules -- The `select` permission automatically grants `count` permission -- Simple filters use fast database `COUNT(*)`, complex filters use Sift.js fallback + - Requires `count` or `select` permission in security rules + - The `select` permission automatically grants `count` permission + - Simple filters use fast database `COUNT(*)`, complex filters use Sift.js fallback
| }, | ||
| "countOnly": true | ||
| } |
There was a problem hiding this comment.
Remove trailing spaces.
Static analysis detects trailing whitespace on these lines within or around the code block.
🧹 Cleanup required
Remove any trailing spaces from lines 516-518 to satisfy markdownlint.
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
516-516: Trailing spaces
Expected: 0; Actual: 2
(MD009, no-trailing-spaces)
517-517: Trailing spaces
Expected: 0; Actual: 2
(MD009, no-trailing-spaces)
518-518: Trailing spaces
Expected: 0; Actual: 2
(MD009, no-trailing-spaces)
🤖 Prompt for AI Agents
In `@docs/REST-API/fliplet-datasources.md` around lines 516 - 518, Remove the
trailing whitespace characters in the JSON code block—specifically trim any
trailing spaces after the closing brace and after the "countOnly": true line so
the lines containing "countOnly": true and the subsequent closing brace contain
no extra spaces; update the block around the keys/values shown in the diff (the
lines with the closing brace and "countOnly": true) to eliminate trailing
whitespace and pass markdownlint.
Summary
docs/API/fliplet-datasources.md)docs/REST-API/fliplet-datasources.md)docs/Data-source-security.md)Related
Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.