-
Notifications
You must be signed in to change notification settings - Fork 12
feat: implement URL store API #1400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
nitinja
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need some sort of ordering functionality, for example:
High value pages in url store needs to be sorted on rank (or may be traffic) etc.
API Enhancements: - Add sortBy and sortOrder query parameters to all listing endpoints - Support sorting by: rank, traffic, url, createdAt, updatedAt - Add rank and traffic fields to add/update operations - Update OpenAPI documentation with new parameters and fields Performance Improvements: - Refactor bulk operations to use Promise.allSettled for parallel processing - Replace sequential for-loops with parallel map operations - Improve response time for bulk add/update/delete operations Code Quality: - Fix all 15 pre-existing linting errors - Remove unused encodeUrlToBase64 function - Eliminate no-continue statements (7 instances) - Eliminate no-await-in-loop violations (7 instances) - Fix trailing spaces and OpenAPI YAML syntax errors - All linting now passing (0 errors)
- Resolved conflicts in src/index.js and src/routes/index.js - Kept both URL Store Controller and PTA2 Controller features
Add REST API endpoints to manage and query offsite brand presence URLs
(Wikipedia, YouTube, social media, etc.) alongside primary site URLs.
New Endpoints:
- GET /sites/{siteId}/url-store/by-platform/{platformType}
Query URLs by specific platform type with sorting/pagination
- GET /sites/{siteId}/url-store/offsite
Get all offsite URLs with sorting/pagination
Controller Changes:
- Add listUrlsByPlatform() endpoint handler
- Add listOffsiteUrls() endpoint handler
- Update addUrls() to accept and validate platformType
- Update updateUrls() to accept and validate platformType
- Import PLATFORM_TYPES from data access layer
OpenAPI Documentation:
- Document new endpoints with full specifications
- Add platformType field to all URL schemas
- Include sorting parameters (rank, traffic, etc.)
- Add platform type enum validation
Testing:
- Add 13 comprehensive controller tests
- Test platform type validation
- Test sorting and pagination
- Test default value behavior
All endpoints support sorting by rank, traffic, url, createdAt, updatedAt
with asc/desc ordering and cursor-based pagination.
Note: OpenAPI validation warnings for nullable fields are pre-existing
and tracked separately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @HollywoodTonight, LGTM
Please ensure your pull request adheres to the following guidelines:
describe here the problem you're solving.
If the PR is changing the API specification:
yet. Ideally, return a 501 status code with a message explaining the feature is not implemented yet.
If the PR is changing the API implementation or an entity exposed through the API:
If the PR is introducing a new audit type:
Related Issues
Thanks for contributing!