feat(api): add finite durable session history pages (#34097)

This commit is contained in:
Kit Langton 2026-06-26 20:49:47 +02:00 committed by GitHub
parent af0b7ffae7
commit 65210f2d97
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 1235 additions and 112 deletions

View file

@ -410,12 +410,12 @@ function renderImportedProjection(groups: ReadonlyArray<Group>, endpoints: Reado
function renderPromiseTypes(groups: ReadonlyArray<Group>) {
const types = new Map<SchemaAST.AST, string>()
const typeOf = (schema: Schema.Top) => {
const encoded = Schema.toEncoded(schema)
const cached = types.get(encoded.ast)
const typeOf = (schema: Schema.Top, decoded = false) => {
const projected = decoded ? Schema.toType(schema) : Schema.toEncoded(schema)
const cached = types.get(projected.ast)
if (cached !== undefined) return cached
const type = structuralType(encoded)
types.set(encoded.ast, type)
const type = structuralType(projected)
types.set(projected.ast, type)
return type
}
const errors = new Map(
@ -449,7 +449,7 @@ function renderPromiseTypes(groups: ReadonlyArray<Group>) {
const schema = schemas[field.source]
if (schema === undefined)
throw new GenerationError({ reason: `Missing input schema: ${prefix}.${field.name}` })
return `readonly ${JSON.stringify(field.name)}${field.optional ? "?" : ""}: (${typeOf(schema)})[${JSON.stringify(field.name)}]`
return `readonly ${JSON.stringify(field.name)}${field.optional ? "?" : ""}: (${typeOf(schema, field.source === "query")})[${JSON.stringify(field.name)}]`
})
.join("; ")
const successSchema = endpoint.successes[0]