Skip to content

feat: introduce query-index editing endpoint#2134

Merged
vivesing merged 7 commits intomainfrom
feat/onboarding
Apr 8, 2026
Merged

feat: introduce query-index editing endpoint#2134
vivesing merged 7 commits intomainfrom
feat/onboarding

Conversation

@vivesing
Copy link
Copy Markdown
Contributor

@vivesing vivesing commented Apr 6, 2026

POST /llmo/onboard/update-query-index

Purpose

Adds new file entries to a site's query-index.xlsx spreadsheet in SharePoint, then triggers AEM Edge Delivery to preview and publish the updated index so it becomes available as JSON on the CDN.

Request

Auth: LLMO Administrator only (via access control check)

Body:

{
    "domain": "https://abcxyztestdev.com",
    "fileNames": [
      "brand-presence/brandpresence-ai-mode-w10-2026.json",
      "brand-presence/brandpresence-ai-mode-w11-2026.json"
    ]
}
Field Type Required Description
domain string Yes Domain used to look up the site and its LLMO config
fileNames string[] Yes List of content file names to register in the query index

Flow

  1. Validates the caller is an LLMO administrator
  2. Looks up the site by domain and reads its dataFolder from LLMO config
  3. Appends rows to query-index.xlsx in SharePoint — each row contains /<dataFolder>/<fileName>.json and current timestamps
  4. Calls AEM Admin API (admin.hlx.page) to preview then publish query-index.json

Response

200 OK

{
  "message": "query-index.xlsx updated, previewed, and published successfully",
  "domain": "example.com",
  "dataFolder": "example-com",
  "entriesAdded": 2
}

Error Responses

Status Condition
400 Missing body, missing domain, empty/invalid fileNames, or site not onboarded (no dataFolder)
403 Caller is not an LLMO administrator
404 Site not found for the given domain
500 SharePoint write failure, or AEM Admin API preview/publish failure

Files Changed

File Change
src/controllers/llmo/llmo-onboarding.js Added appendRowsToQueryIndex and previewAndPublishQueryIndex functions
src/controllers/llmo/llmo.js Added updateQueryIndex controller method
src/routes/index.js Registered POST /llmo/onboard/update-query-index route
src/routes/required-capabilities.js Added route to INTERNAL_ROUTES (not exposed to S2S consumers)
test/controllers/llmo/llmo-onboarding.test.js 8 new tests covering appendRowsToQueryIndex and previewAndPublishQueryIndex
test/controllers/llmo/llmo.test.js 10 new tests covering the updateQueryIndex controller
test/routes/index.test.js Added route to static routes list and handler assertions

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

This PR will trigger a minor release when merged.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@vivesing
Copy link
Copy Markdown
Contributor Author

vivesing commented Apr 7, 2026

Example request response:
image

updated query index:
image

@vivesing vivesing requested a review from calvarezg April 8, 2026 05:03
@vivesing vivesing merged commit 065cfa5 into main Apr 8, 2026
20 checks passed
@vivesing vivesing deleted the feat/onboarding branch April 8, 2026 11:49
solaris007 pushed a commit that referenced this pull request Apr 8, 2026
# [1.422.0](v1.421.3...v1.422.0) (2026-04-08)

### Features

* introduce query-index editing endpoint ([#2134](#2134)) ([065cfa5](065cfa5))
@solaris007
Copy link
Copy Markdown
Member

🎉 This PR is included in version 1.422.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants