Repository navigation
feat: collections stage 3 store and API (RFC-0042 step 2) - #104
Merged
Merged
Conversation
- updateSite/createSite check listFields, expiry (invalid_expiry) and structured-data presets (structured_data_invalid; warnings saved). list_field_in_use (409) when a field that contentList sections filter or sort by is unlisted, dropped or retyped, guarded on the site CAS. - Page writes check contentList where/orderBy (invalid_query, 422). - Field operations carry listFields, expiry and structured-data references through renames and refuse removals and type changes that would break them. - queryContentEntries / applyFieldQuery with the shared evaluator; GET /entries takes where, orderBy, limit and cursor. Shared suites on sqlite, D1 and DO SQLite. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Madraka <8898640+Madraka@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Step 2 of RFC-0042's rollout (ADR-0044), built on #103.
Site writes (only when
collectionschanges; dry runs too)listFieldsandexpiry.fieldmust exist (unknown_field), and the expiry field must be a date or datetime (invalid_expiry, 422).checkPreset: errors are refused withstructured_data_invalid(422); warnings are saved.list_field_in_use(409) refuses unlisting, dropping or retyping a field that acontentListsection filters or sorts by, and dropping a select option a section compares with.details.pagesnames the pages. One SQL predicate counts the uses and also guards the site CAS (rule 4); a racing test covers it.Page writes: changed
contentListwhere/orderByare checked withcheckFieldQuery, soinvalid_query(422) comes back with paths. Unchanged sections are not re-checked.Field operations (RFC-0041)
rename_fieldalso renames the field inlistFields,expiry, structured-data sources and sections' queries, in one batch. Revert renames them back.remove_fieldandchange_field_typerefuse withlist_field_in_usewhile something still references the field.Queries:
queryContentEntries/applyFieldQueryuse the shared evaluator overresolveFields.sort, thenid.API:
GET /api/sites/:id/entriestakes:where: a JSON list ofFieldCondition;orderBy: a JSONFieldOrder;limit: 1–100, which switches the answer to{entries, total, nextCursor?};cursor.Without these the answer is exactly as before. Bad input gets
invalid_querywith paths.Note:
expirycan be saved but is not applied on the site until step 3 (the renderer gate and thegates: 2guard). Release only after step 3.Tests
Changeset: minor (
core-ts,api).🤖 Generated with Claude Code