Skip to content

fix(list): validate --limit and add ft waitlist (contract 1.24) - #51

Merged
lu-ochenty merged 2 commits into
mainfrom
fix/cli-audit-2026-11
Nov 1, 2026
Merged

lu-ochenty merged 2 commits into
mainfrom
fix/cli-audit-2026-11

Conversation

@LucasLeguizamo

@LucasLeguizamo LucasLeguizamo commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

What changes

  • --limit is now validated (integer 1-100). Previously --limit 500|abc|0 reached the API and silently returned the default page of 20.
  • Sync of the v1 contract 1.20.0 -> 1.24.0 (additive: waitlist + allocations[].amount/mode).
  • New ft waitlist list|create, the only production B2B endpoint that had no command.

Flow diagram

flowchart LR
  A[ft ... --limit N] --> B{parseLimit 1-100}
  B -- invalid --> C[exit 1 + message]
  B -- ok --> D[/api/v1/]
Loading

How to test

pnpm install && pnpm generate && pnpm lint && pnpm typecheck && pnpm test && pnpm build
node dist/index.js events list --limit 500   # exit 1
node dist/index.js waitlist list --help

🤖 Generated with Claude Code

LucasLeguizamo and others added 2 commits November 1, 2026 15:11
--limit 500 o --limit abc llegaban a la API y volvían en silencio con la
página por defecto de 20. parseLimit() falla con exit 1 y un mensaje claro;
aplicado en resource list, admin list y api-keys list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fo7cm6n2VPy94zeSbmhgt8
Sincroniza openapi.json a 1.24.0 y cablea GET/POST /waitlist, el unico
endpoint B2B del spec de prod que el CLI no exponia. `list` filtra con
--city y hereda --workspace/--account/--all/--csv del patron resource.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fo7cm92jLJxUttSHQHWMAk
@LucasLeguizamo LucasLeguizamo added the enhancement New feature or request label Nov 1, 2026
@qodo-code-review

qodo-code-review Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

Grey Divider

Sorry, something went wrong

We weren't able to complete the code review on our side. Please try again manually by commenting /agentic_review on this PR.

Grey Divider

Qodo Logo

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Validate list limits and add waitlist commands for API 1.24

🐞 Bug fix ✨ Enhancement 🧪 Tests 📝 Documentation 🕐 20-40 Minutes

Grey Divider

AI Description

• Reject list limits outside 1–100 instead of silently receiving the API’s default page.
• Add ft waitlist list|create, including city filtering and existing workspace-aware list options.
• Sync the B2B API contract to 1.24 and document the new commands.
Diagram

graph TD
  CLI["ft CLI"] --> Limit{"Valid limit?"} --> Lists["List handlers"] --> SDK["Generated SDK"] --> API["B2B API"]
  Limit -- "invalid" --> Exit["Exit 1"]
  CLI --> Waitlist["Waitlist commands"] --> SDK
  Contract["OpenAPI 1.24"] --> SDK
Loading
High-Level Assessment

Reuse of the shared input validator and resource command registration is appropriate: it covers the existing list paths and gives waitlist the established workspace, pagination, and output behavior without a separate command framework. A custom waitlist implementation would duplicate that behavior.

Files changed (11) +5236 / -4590

Enhancement (2) +5173 / -4583
openapi.jsonSync the B2B contract to version 1.24 +5154/-4583

Sync the B2B contract to version 1.24

• Updates the specification from 1.20.0 to 1.24.0, including GET and POST '/waitlist', their schemas and access requirements, and optional allocation amount and mode fields. It also incorporates intervening API documentation and response details; much of the large diff reflects reordered paths and schemas.

openapi.json

program.tsRegister waitlist list and create +19/-0

Register waitlist list and create

• Connects generated waitlist SDK operations to the shared resource command pattern. Configures list columns and the '--city' query filter.

src/program.ts

Bug fix (4) +22 / -6
admin.tsValidate admin resource list limits +2/-2

Validate admin resource list limits

• Replaces numeric conversion with the shared limit validator for paginated admin resource lists.

src/commands/admin.ts

api-keys.tsValidate API-key list limits +2/-2

Validate API-key list limits

• Validates and converts the API-key list page size before adding it to the request query.

src/commands/api-keys.ts

resource.tsValidate limits in shared resource lists +3/-2

Validate limits in shared resource lists

• Applies shared limit validation before resource-list pagination and query construction. This also covers the new waitlist list command.

src/commands/resource.ts

input.tsAdd a shared 1–100 limit parser +15/-0

Add a shared 1–100 limit parser

• Introduces 'parseLimit' to return a numeric page size or fail with a clear error and an '--all' hint.

src/lib/input.ts

Tests (2) +30 / -1
input.test.tsTest accepted and rejected list limits +21/-1

Test accepted and rejected list limits

• Covers the 1 and 100 boundaries, a typical value, and invalid zero, oversized, fractional, nonnumeric, and empty inputs. Rejected values are checked for exit status 1.

src/lib/input.test.ts

program.test.tsCheck waitlist command registration +9/-0

Check waitlist command registration

• Verifies that waitlist list and create are registered and that list exposes the city and account options.

src/program.test.ts

Documentation (3) +11 / -0
validate-limit.mdRecord the list-limit validation patch +5/-0

Record the list-limit validation patch

• Adds a patch changeset describing the new 1–100 validation and explicit failure for invalid '--limit' values.

.changeset/validate-limit.md

waitlist.mdRecord the waitlist feature release +5/-0

Record the waitlist feature release

• Adds a minor changeset for the waitlist list and create commands and the city filter.

.changeset/waitlist.md

README.mdDocument waitlist CLI commands +1/-0

Document waitlist CLI commands

• Adds waitlist list and create to the command reference, noting the city filter, personal-data export, and enterprise service-key requirement.

README.md

@LucasLeguizamo LucasLeguizamo changed the title fix(list): validar --limit y agregar ft waitlist (contrato 1.24) fix(list): validate --limit and add ft waitlist (contract 1.24) Nov 1, 2026
@lu-ochenty
lu-ochenty merged commit f5dbd24 into main Nov 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants