tilie_server.routers.claim_events#

The MatchClaims’ events: what each side of given MatchClaims names.

The editor holds a package’s MatchClaim table for its session only. To show a MatchClaim it asks the server for the events on its two sides (POST /api/match-claims/events): each side’s timeline, event ID and event name as the MatchClaim table states them, the MatchClaim’s certainty and whether it states synchrony. The repository’s decisions/0032-match-claim-events.md fixes the route.

The request is the parameters behind their length, as the provenance routes take them ({"claims": [<MatchClaim ID>, …]}), then the body of POST /api/match-claims unchanged. The table is checked against the manifest by TimeToShare’s table checks; timetoalign reads it.

tilie_server.routers.claim_events.EVENTS_PARAMETERS = ('claims',)#

The parameters of the events route.

tilie_server.routers.claim_events.SIDE_COLUMNS = ('timeline_{}_id', 'event_{}_id', 'event_{}_name')#

The MatchClaim table’s columns of one side, {} the side’s letter.

tilie_server.routers.claim_events.ANSWERED_COLUMNS = ('id', 'timeline_a_id', 'event_a_id', 'event_a_name', 'timeline_b_id', 'event_b_id', 'event_b_name', 'certainty', 'is_synchronous')#

The members of an answered MatchClaim, in the order answered.

tilie_server.routers.claim_events.events_answer(body, bounds)[source]#

The events of the MatchClaims a request names, its table read within bounds.

Returns:

{"claims": [...]} in the order the request names them, each {"id", "timeline_a_id", "event_a_id", "event_a_name", "timeline_b_id", "event_b_id", "event_b_name", "certainty", "is_synchronous"}, the values as timetoalign reads the MatchClaim table (None where a cell is null: an event without a name). A side naming no event answers the table’s reserved string as its event ID, NOMATCH_SENTINEL or CHUNK_SENTINEL, and no name.

Raises:

Refusal – As split_parameters() and the table route for the rest of the body; 422 if claims is no list, or names a MatchClaim the table lacks (at ["claims", index]).

Parameters:
Return type:

dict[str, Any]

tilie_server.routers.claim_events.match_claim_events(body, bounds)[source]#

Answer the events of the MatchClaims named, of the posted table.

The body is the parameters’ length in bytes (a little-endian 32-bit integer), the parameters {"claims": [<MatchClaim ID>, …]} as JSON, then the body POST /api/match-claims takes. The answer is JSON {"claims": [...]} (events_answer()). Refusals answer as that route’s, the parameters’ at their name.

Parameters:
  • body (Annotated[bytes, Depends(dependency=~tilie_server.manifests.posted_body, use_cache=True, scope=function)])

  • bounds (Annotated[TableBounds, Depends(dependency=~tilie_server.routers.match_claims.table_bounds, use_cache=True, scope=None)])

Return type:

Response