Skip to content

Feat/creator utils 28 29 30 31#38

Merged
Chucks1093 merged 5 commits into
accesslayerorg:mainfrom
caxtonacollins:feat/creator-utils-28-29-30-31
Mar 26, 2026
Merged

Feat/creator utils 28 29 30 31#38
Chucks1093 merged 5 commits into
accesslayerorg:mainfrom
caxtonacollins:feat/creator-utils-28-29-30-31

Conversation

@caxtonacollins
Copy link
Copy Markdown
Contributor

feat: creator utils — filter parser, handle normalizer, public stats helper, pagination constants

Closes #28
Closes #29
Closes #30
Closes #31

What's in this PR

#28 — Creator filter parser (creators.filter.ts)
Parses verified and search filter inputs from raw query objects. Rejects unsupported filter keys with a clear error. Pure function, reusable across any list handler.

#29 — Handle normalization helper (creators.handle.ts)
normalizeCreatorHandle lowercases, trims, and strips unsupported characters from creator handles. Idempotent — same input always returns the same output.

#30 — Public creator stats helper (creators.stats.ts)
serializePublicCreatorStats formats internal CreatorMetrics into a PublicCreatorStats shape. One consistent response structure for all public creator endpoints.

#31 — Pagination constants module (src/constants/pagination.constants.ts)
Centralizes DEFAULT_PAGE_SIZE, DEFAULT_PAGE, DEFAULT_OFFSET, MAX_PAGE_SIZE, and MIN_PAGE_SIZE. Single source of truth — easy to update across all list endpoints.

Notes

  • No existing files were modified
  • All new files pass lint and type checks
  • Pre-existing build errors in creator.utils.ts, wallet.types.ts, and prisma.utils.ts are unrelated to this PR (Prisma client not generated in dev environment)

- parse verified and search filter inputs from raw query objects
- reject unsupported filter keys with a descriptive error
- keep parser pure and reusable across list handlers
- normalize casing, spacing, and special characters in creator handles
- idempotent: repeated calls with same input return same result
- small and reusable across creator flows
- define PublicCreatorStats shape for public endpoints
- serializePublicCreatorStats formats CreatorMetrics for API responses
- reusable across creator endpoints with one consistent output shape
- centralize DEFAULT_PAGE_SIZE, DEFAULT_PAGE, DEFAULT_OFFSET, MAX_PAGE_SIZE, MIN_PAGE_SIZE
- reusable for all current and future list endpoints
- single source of truth for pagination defaults
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Mar 26, 2026

@caxtonacollins Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Chucks1093 Chucks1093 merged commit ac597aa into accesslayerorg:main Mar 26, 2026
1 check 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

2 participants