Skip to content

Conversation

@HollywoodTonight
Copy link
Contributor

Please ensure your pull request adheres to the following guidelines:

  • make sure to link the related issues in this description. Or if there's no issue created, make sure you
    describe here the problem you're solving.
  • when merging / squashing, make sure the fixed issue references are visible in the commits, for easy compilation of release notes

If the PR is changing the API specification:

  • make sure you add a "Not implemented yet" note the endpoint description, if the implementation is not ready
    yet. Ideally, return a 501 status code with a message explaining the feature is not implemented yet.
  • make sure you add at least one example of the request and response.

If the PR is changing the API implementation or an entity exposed through the API:

  • make sure you update the API specification and the examples to reflect the changes.

If the PR is introducing a new audit type:

  • make sure you update the API specification with the type, schema of the audit result and an example

Related Issues

Thanks for contributing!

@HollywoodTonight HollywoodTonight requested a review from a team November 4, 2025 11:29
Copy link
Member

@nitinja nitinja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@nitinja nitinja left a 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.
Copy link
Member

@nitinja nitinja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @HollywoodTonight, LGTM

@nitinja nitinja self-requested a review November 18, 2025 20:18
@iuliag iuliag changed the title URL Store feat: implement URL store API Nov 18, 2025
…ery parameter

Replace the 'source' string attribute with 'byCustomer' boolean to simplify
filtering and clearly distinguish between customer-added (true) and
system-added (false) URLs.

API Changes:
- Update GET /sites/{siteId}/url-store to accept byCustomer query parameter (default: true)
- Remove GET /sites/{siteId}/url-store/by-source/{source} endpoint
- Update listUrls() to filter by byCustomer with default true
- Remove listUrlsBySource() function
- Update addUrls() to use byCustomer instead of source
- Update deleteUrls() to check byCustomer instead of source

OpenAPI Changes:
- Add byCustomer query parameter to url-store-list endpoint
- Remove url-store-by-source endpoint documentation
- Update all schemas: AuditUrl, AuditUrlInput with byCustomer boolean
- Update example responses to use byCustomer

Migration:
- source='manual' → byCustomer=true
- source='sitemap'/'discovery'/other → byCustomer=false
Resolve conflict in src/routes/index.js:
- Keep both urlStoreController and pta2Controller in JSDoc
- Both controllers already present in function signature
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.

2 participants