Skip to content

Conversation

@tonytlwu
Copy link
Contributor

@tonytlwu tonytlwu commented Jan 20, 2026

Summary

  • Add "Count Records Only" section to JS API docs (docs/API/fliplet-datasources.md)
  • Add "Count Only Query" section to REST API docs (docs/REST-API/fliplet-datasources.md)
  • Add operation types table to security rules docs (docs/Data-source-security.md)
  • Add 'count' case to custom security rule switch example

Related

  • Jira: DEV-859
  • API PR: Fliplet/fliplet-api#7495

Test plan

  • Verify JS API docs render correctly with countOnly examples
  • Verify REST API docs show Count Only Query section
  • Verify security docs show operation types table
  • Verify all code examples are syntactically correct

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Added documentation for a "Count Records Only" query option with syntax, return type and usage examples (counting, filtering, existence checks).
    • Added guidance for a new "count" operation in security rules with example handling.
    • Extended data source permissions to include a new "count" permission and documented permission and filter behaviour for count-only queries.

✏️ Tip: You can customize this high-level summary in your review settings.

- 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>
@coderabbitai
Copy link

coderabbitai bot commented Jan 20, 2026

Walkthrough

Adds documentation for a new "count" capability for Fliplet Data Sources: a countOnly option on connection.find(...), a count permission type in security rules, and examples/notes showing request/response shapes and permission requirements.

Changes

Cohort / File(s) Summary
API docs: Count usage
docs/API/fliplet-datasources.md
Added "Count Records Only" section with purpose, syntax (connection.find({ countOnly: true, where?: object })), return type (Promise<number>), usage examples (count all, filtered count, existence check) and security notes. (Note: duplicated block present in the file.)
REST API docs: Count query & permissions
docs/REST-API/fliplet-datasources.md
Added countOnly to query operators, new "Count Only Query" request/response examples, notes on filter handling and implementation, and updated permissions list to include count.
Security rules docs: count operation
docs/Data-source-security.md
Added count as a supported operation in examples and switch handling guidance; documents that the input is a filter and select implies count (backwards-compatible), with example logic for the count case.

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

  • Arpanexe
  • debankurghosh2061
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarises the main changes: documenting the countOnly parameter and count security rule type across multiple documentation files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: Add type field 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
 }

tonytlwu and others added 2 commits January 20, 2026 21:47
- 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>
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: Include type field 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

Comment on lines +516 to +518
},
"countOnly": true
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant