Skip to content

Add resourceKeyResolver for rate-limit keys#11

Merged
AllyMurray merged 4 commits into
mainfrom
feat-resource-key-resolver
Apr 6, 2026
Merged

Add resourceKeyResolver for rate-limit keys#11
AllyMurray merged 4 commits into
mainfrom
feat-resource-key-resolver

Conversation

@AllyMurray
Copy link
Copy Markdown
Owner

@AllyMurray AllyMurray commented Apr 6, 2026

Summary

  • add a non-breaking top-level resourceKeyResolver?: (url: string) => string to HttpClientOptions
  • route rate-limit key resolution through a single helper used by store accounting and server cooldown handling
  • preserve precedence and compatibility: resourceKeyResolver, then deprecated rateLimit.resourceExtractor, then the existing default fallback
  • add coverage for default behavior, resolver precedence, legacy fallback, canProceed, getWaitTime, record, and retrieve/list normalization into one bucket
  • deprecate rateLimit.resourceExtractor in the public TypeScript API and update docs to recommend resourceKeyResolver for new usage
  • stabilize the SQLite adaptive rate-limit test so the full repo hook suite passes without --no-verify

Verification

  • pnpm --filter @http-client-toolkit/core test
  • pnpm --filter @http-client-toolkit/core build
  • pnpm --filter @http-client-toolkit/store-sqlite test
  • pnpm --filter @http-client-toolkit/store-sqlite build
  • pnpm build
  • pnpm lint
  • pnpm test

All commands passed locally, and the branch was pushed with the normal pre-push hook enabled.

@AllyMurray AllyMurray merged commit c94f7c6 into main Apr 6, 2026
1 check passed
@AllyMurray AllyMurray deleted the feat-resource-key-resolver branch April 6, 2026 12:52
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