Skip to content

feat: REST-backed problems command and problem alias - #1

Merged
tamnd merged 1 commit into
mainfrom
feat/rest-problems
Jun 14, 2026
Merged

tamnd merged 1 commit into
mainfrom
feat/rest-problems

Conversation

@tamnd

@tamnd tamnd commented Jun 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add leetcode problems using GET /api/problems/all/ (REST) — returns int IDs plus submission stats (submitted, accepted) and paid_only flag; problems sorted newest-first by ID; difficulty filter is case-insensitive client-side
  • Add leetcode problem <slug> as a cleaner alias for the existing question command
  • New type RestProblem in leetcode/leetcode_rest.go with separate REST GET transport sharing the same pacing/retry/backoff logic as GraphQL POST
  • Existing list and question commands unchanged (backward compatible)

Test plan

  • go test ./... passes (13 tests green, including 5 new REST-specific tests)
  • go build ./... and go vet ./... clean
  • leetcode problems --difficulty easy --limit 5 lists Easy problems
  • leetcode problem two-sum shows problem detail
  • leetcode daily still works

Add `leetcode problems` backed by GET /api/problems/all/ returning
int IDs plus submission stats (submitted, accepted) and paid_only flag.
Problems are sorted newest-first by ID; difficulty filter is
case-insensitive client-side.

Add `leetcode problem <slug>` as a cleaner alias for `question`
(existing `list` and `question` commands unchanged).

New types: RestProblem in leetcode_rest.go.
New tests: TestProblemsSendsUserAgent, TestProblemsParsesItems,
TestProblemsFilterByDifficulty, TestProblemsLimit,
TestProblemsRESTRetriesOn503 in rest_test.go.
@tamnd
tamnd merged commit 2be3135 into main Jun 14, 2026
6 checks passed
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