Repository navigation
chore: version packages - #583
Merged
Merged
Conversation
github-actions
Bot
force-pushed
the
changeset-release/trunk
branch
21 times, most recently
from
November 12, 2026 06:18
868b5ff to
8790de3
Compare
github-actions
Bot
force-pushed
the
changeset-release/trunk
branch
6 times, most recently
from
November 12, 2026 07:25
a8de2f8 to
c453767
Compare
github-actions
Bot
force-pushed
the
changeset-release/trunk
branch
from
November 12, 2026 07:33
c453767 to
10a7469
Compare
github-actions
Bot
force-pushed
the
changeset-release/trunk
branch
12 times, most recently
from
November 12, 2026 10:26
ae7b517 to
8fb2fc4
Compare
github-actions
Bot
force-pushed
the
changeset-release/trunk
branch
from
November 12, 2026 10:42
8fb2fc4 to
5985b4a
Compare
thomasfosterau
enabled auto-merge
November 12, 2026 10:55
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.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to trunk, this PR will be updated.
Releases
@thomasfosterau/effect-jsonapi@0.22.0
Minor Changes
51ef5a4: Breaking (types only): the "option omitted" sentinel of the generic option parameters is
never, no longerundefined(Move every @enfect/oxlint rule to error #533). This covers:page/filterparameters ofEndpoint.list,collection,related,getRelationshipandresource, and ofEndpoint.ResourceEndpoint,ResourceEndpointsandResourceOptions;Group.resource'sPage/Filter, and theSurfaceofGroup.flat,Group.flatReadOnly,Group.FlatOptionsandGroup.FlatReadOnlyOptions;Endpoint.polymorphic's andResource.Family'sBase,Resource.attribute'sClearable, andResource.extend's andResource.ExtendedId's custom id;Query.Include'soptions, andQuery.Options'page/filtermembers, which no longer takeundefined;Query.QuerySchema,NestedFields,FlatFieldsandFlatSchemaread aneverpage/filteras absent;Handlers.paginatedRelationship'sSelf;Idempotency.HeadersFor/Applied, which now require anIdempotency.Option;Assemble.unpaginatedCollection'sSelf/M, andAssemble.UnpaginatedCollectionOptionsandUnpaginatedCollectionDocument. Their "maybe passed" state (string | undefined,Meta | undefined), which made the document'slinks/metaoptional, is gone: a document haslinksexactly when aselfis passed, andmetaexactly when ametais.Code that relies on inference is unaffected: omitting an option derives the same query, document, id and
clearabletypes as before. Two kinds of code change:An explicit
undefinedtype argument for one of these parameters is now a constraint error. Omit the type argument, or passnever:Endpoint.ResourceEndpoints<…, Sort, never, never, Meta>,Resource.ExtendedId<BaseId, "editors", false>,Idempotency.HeadersFor<false>,Assemble.UnpaginatedCollectionDocument<R, never, Meta>.An explicit or maybe-
undefinedvalue for one of these options ({ page: undefined }and{ filter: undefined }inEndpoint.*,Group.resourceorQuery.schema;{ include: undefined }inGroup.flat*;{ self: undefined }inHandlers.paginatedRelationship;{ clearable: undefined };{ self: maybeSelf }/{ meta: maybeMeta }inAssemble.unpaginatedCollection) no longer stands for "omitted". UnderexactOptionalPropertyTypesit is a compile error. Leave the key out instead, passing it only when it is defined:Relationship.StorageKeyandRelationship.Paginated'sorderare unchanged: their sentinel is the type of a runtime property, tracked separately.01d1481: Breaking (types only): the published
Schema.TaggedErrorclasses (NotFound,Unauthorized,Forbidden,Redirect,HttpError,ValidationFailure,JsonapiError,UnknownFamily,FamilyMismatch,ErrorResponse,ContractViolation,DomainMismatch,InvalidAllowedQueryParameter) carry a nominal brand, so a structurally compatible object literal is no longer assignable where one of these instances is expected. Instances built withnew, and_tag/instanceofnarrowing, are unaffected. Migration: construct the error withnew(for examplenew ServerErrors.NotFound({ … })) instead of writing an object literal of its shape.ae9270d: Add
capabilitiesOnIncludedtoAssemble.Options(andAssemble.RelationshipInput, and theResourceHandlersread-only, writable and related configs):falsestamps thecapabilitieshook's result on primary data only, leavingincludedmembers without capabilitymeta. It defaults totrue, today's behaviour, so existing callers are unchanged. From gardeneria#1263 O5.5c99ab0: Breaking: the
effectpeer is now^4.1.0(was^4.0.0). The published declarations need effect 4.1's HttpApi types: on effect 4.0.6 aGroup.resourceendpoint's~Successresolves toany, so a typedClient.makeconsumer loses every response type without a compile error at the declaration. Migration: move the application toeffect>= 4.1.0 (website, gardeneria, preferenceflow, in-the-dark) before bumping this package. A new CI job (vp run typecheck:floor) compiles a typedClient.makeconsumer against the packed package and effect 4.1.0 exactly, so the floor cannot drift again (The published declarations need effect 4.1, but the peer range admits ^4.0.0 #586).efb7526: A flat group's include surface now types its documents end to end (
Include.Surface["included"]and the flat groups'includedslot widen decoding services tounknown#595).Group.flat/Group.flatReadOnlykeep the surface'sincludedunion in their success schemas. It used to be inferred while the surface type was still generic, which widened it toSchema.Top: every endpoint's decoding services becameunknown, so a typedClient.makemethod requiredunknown, andeffect/clicommands built on one failed to type-check. A flat group without a surface is unchanged.AssembleandResourceHandlerstypeincludedby the include registry.Assemble.ResourceDocument,CollectionDocumentandUnpaginatedCollectionDocumentgain a trailingIparameter, theincludedmembers' type, defaulting toResourceLike.Assemble.resource/collection/unpaginatedCollectionset it from theirtargetsthrough the newAssemble.TargetsIncluded<Targets>: what the loaders return, orneverwith no registry.ResourceHandlers.readOnly/makehandlers get the same type, with writes typednever. A family's handlers then satisfy a group whoseincludedis the surface's precise union, with no cast. Declare the registry withsatisfies Handlers.IncludeTargetsso the loaders' types stay visible; an annotated registry keeps the looseResourceLike.Schema.Codec<…, never, never>cast around a flat group's documents, and any cast on handler output. Code that names a document's exact type from a call with no registry seesincluded?: ReadonlyArray<never>instead ofReadonlyArray<WireResource<ResourceLike>>, which is still assignable to the old type.4c8f411: Breaking:
Client.IncludedIndex(whatClient.indexIncludedreturns andHydrated.indexcarries) andInclude.Surface'stargetsmember are now an effectHashMapkeyed the same way, no longer a nativeReadonlyMap.Client.related,Client.walkandClient.hydratetake and return them unchanged, so code that only passes the index along is unaffected. Migration: read an entry withHashMap.get(index, key)(anOption) instead ofindex.get(key), test for one withHashMap.has(index, key)instead ofindex.has(key), and count them withHashMap.size(index)instead ofindex.size; the same forsurface.targets. An index you built yourself from aMapbecomesHashMap.fromIterable(entries).cd0af49: Breaking (wire):
Negotiation.NOT_ACCEPTABLE,NOT_ACCEPTABLE_REFUSEDandUNSUPPORTED_MEDIA_TYPEnow carry the codesnot_acceptableandunsupported_media_type, the spellingsApiError.NotAcceptable/ApiError.UnsupportedMediaType(and soNegotiation.toApiError) already use. They replace the hyphenatednot-acceptable/unsupported-media-type(feat: JSON:API content negotiation on top of @thomasfosterau/effect-ext/Negotiate #577). These are the canonical codes of the two negotiation errors: effect-ext'sNegotiatereturns a tagged verdict and defines none of its own. Migration: a host or test matchingerrors[].codeon a 406 / 415 fromNegotiation.errorResponsereads the underscored code.2688394:
Negotiation.representation({ extensions, servesPath })andNegotiation.toApiError(negotiation): the JSON:API half of a media-type-agnostic negotiator such as@thomasfosterau/effect-ext/Negotiate'snegotiateRepresentation(feat: JSON:API content negotiation on top of @thomasfosterau/effect-ext/Negotiate #577).representationis the JSON:APIRepresentation, whoseacceptsParametersis JSON:API §5's rule (onlyext/profile, everyextURI inextensions, none by default).toApiErrormaps that negotiator'sNotAcceptable/UnsupportedMediaTyperefusal of the JSON:API representation toApiError.NotAcceptable(406) /ApiError.UnsupportedMediaType(415), and anything else toOption.none(). Both are typed structurally, so this package does not import effect-ext'sNegotiate(whose former optional peer on this package was a cycle).dbae674: Breaking (types): the published declarations no longer spell
any(Move every @enfect/oxlint rule to error #533, Pay down the type-aware lint findings (tsgolint) #536). Almost every site widens to the same set of accepted values (unknown, a constrained generic orneverin a parameter position), so call sites compile unchanged; the ones a consumer can notice are inRegistry:Registry.RawHandler<R>takesrequest: never(wasany) andRdefaults tounknown(wasany);Registry.Family<R>defaults tounknowntoo. A host that called a handler out offamily.handlersdirectly, or annotatedRegistry.Familybare and then passed it towebHandler, now supplies a typed request andContextitself. Migration: annotateRegistry.Family<YourServices>, and type the request you hand a raw handler.Registry.HandlersFor<G>types a handler's error and requirement channels asunknown(wasany). Declarations written withsatisfies Registry.FamilyFor<typeof group>are unaffected: theResourceHandlersconstructors (make,readOnly) returnNoInfer<…>so the requirement channel is not inferred from that contextual type.Registry.familyLayer,Registry.layerandRegistry.webHandlerare generic over the api's identifier and groups (HttpApi.HttpApi<ApiId, Groups>) rather than takingHttpApi.HttpApi<any, any>. Any concreteHttpApistill passes; a caller that held its api asHttpApi<any, any>should pass the concrete value.Client.decodeInputconstrainsStoSchema.Codec<unknown, unknown, unknown, unknown>(wasSchema.Top), so the schema is decoded without an internal assertion. A value typed only asSchema.Topmust be narrowed to a codec first.Resource.createAttributeFieldsandResource.updateAttributeFieldsreturnCreateAttributes<A>/UpdateAttributes<A>(wasRecord<string, Schema.Top>);Resource.attributeKeys,relationshipKeys,sortable,annotate,Include.paths,Document.wire,Document.LinkageDocument,Atomic.Operations,Assemble.toWireSafeResourceandQuery.bracketPageKeysare now overloaded function declarations with the same call signature.Also widened without a consumer-visible effect: the
Schema.Codec<any, string>id-schema bound (nowSchema.Codec<unknown, string>) acrossResource,EndpointandGroup;Handlers.IncludeTargetsloaders (IncludeTarget<ResourceValue, unknown, unknown>); theResource.Familybound of the include-path helpers; andQuery.bracketKeys's input constraint.Resource.extend,Resource.annotate,Resource.familyandApiError.makeno longer round-trip throughas unknown asinternally; their signatures are unchanged.a41d580: Breaking:
Client,Conformance,Middleware,Negotiation,Registry,ServerErrors,ApiErrorandIdempotencyno longer spell "absent" asundefinedin their options and results (effect/prefer-option-over-null, 4 of 6, Move every @enfect/oxlint rule to error #533). Options members arereadonly x?: T, so underexactOptionalPropertyTypesthey no longer accept an explicitundefined; a "maybe" result is anOption; a record member that may be absent is optional.Options members (
readonly x?: T | undefined→readonly x?: T):Client.MakeOptions:baseUrl,transformClient,transformResponse,decodeErrors.Client.PageCursorOptions:key,defaultLimit,maxLimit.Conformance.Options:ids,paths,absentId,extensions,mutating,writes,tiers,only,skip,requestTimeout,target;Conformance.format'swidth.Conformance.WriteFixture:create,update,cleanup,clientId.Middleware.QueryParameterOptions.allowedQueryParameters,Middleware.SchemaErrorsOptions.checkLinkage,Middleware.QueryParameterCheck.declared.Negotiation.Options:fallback,alternates.Registry.Options.respond;Registry.webHandler'sdisableLogger.ServerErrors.SchemaIssueOptions:status,prefix;ServerErrors.RespondOptions:materialise,override.Results and signatures:
Middleware.negotiate(headers, options?)takes the request's headers as aHeaders.Input— a webHeaders(request.headers), an effectHeadersor a plain record — instead of{ contentType?, accept? }, and returnsOption<UnsupportedMediaType | NotAcceptable>(was the error orundefined).Middleware.checkQueryParametersreturnsOption<ErrorDocument>(was the document orundefined).Middleware.contentTypeIsAcceptable/acceptIsAcceptabletakeheader?: string(was a requiredstring | undefined).ApiErrorclasses' statictitleisOption<string>(wasstring | undefined).ApiError.make'sdetail/sourcecallbacks return the value, or anOptionof it when an occurrence may carry none (was the value orundefined).Client.related/Client.walktakedata: LinkedResource(wasLinkedResource | undefined; pass{}for no primary data —Client.hydratedoes).Client.indexIncluded(included?)takes an optional parameter.Client.LooseInput<T>is{ readonly [K in keyof T]?: T[K] }(no| undefined); build one from maybe-undefined values withClient.stripUndefined.Client.PageFiltersis{ readonly [key: string]: string }.Conformance.Report'swrites/samples,Conformance.Write'sid/detail, aFinding'sprobeand aPassedoutcome'snoteare optional members (aWrite'sidanddetail, a finding'sprobeand a pass'snotewere requiredT | undefined).Idempotency.headersFor(internal) returnsOption<Schema.Top>.Migration for the apps:
An options key whose value may be
undefinedis left out rather than set toundefined. A conditional empty-object spread (...(x === undefined ? {} : { x })) is rejected byeffect/no-conditional-empty-object-spread, so copy this helper (it is what the package uses internally) and spread one call per key:For a value already held as an
Option, the same shape withif (Option.isSome(value)) member[key] = value.value(the package'ssomeMember).A "maybe" result is now an
Option:Option.getOrUndefinedkeeps the old behaviour (Option.getOrUndefined(Middleware.negotiate(request.headers)));Option.isSome/Option.matchreplace the!== undefinedchecks.Middleware.negotiate({ contentType, accept })becomesMiddleware.negotiate(request.headers)(or{ "content-type": …, accept: … }).A
detail/sourcecallback that returnedundefinedreturns anOptioninstead:(e) => Option.fromUndefinedOr(e.reason).Wire shapes are unchanged.
442a256: Breaking:
Negotiation.Options'onExplicitRefusalandextensionsarereadonly x?: T, like the rest of its members (effect/prefer-option-over-null, 6 of 6, Move every @enfect/oxlint rule to error #533): they were?: T | undefined, so underexactOptionalPropertyTypesthey no longer accept an explicitundefined.Migration for the apps: leave the key out rather than set it to
undefined. With a maybe-undefined value, spread onedefinedMember("extensions", extensions)(the helper the 4-of-6 changeset gives) into the options object instead of writingextensions: extensions; a conditional empty-object spread is rejected byeffect/no-conditional-empty-object-spread.ed15763: Breaking: the server modules (
Assemble,Handlers,ResourceHandlers,Document,Endpoint,Query,FlatQuery,Group,Filter,Resource,Lid) no longer spell "absent" asundefinedin their options and results (effect/prefer-option-over-null, 3 of 6, Move every @enfect/oxlint rule to error #533). Options members arereadonly x?: T, so underexactOptionalPropertyTypesthey no longer accept an explicitundefined. A "maybe" result is anOption, and a record member that may be absent is optional.Options members (
readonly x?: T | undefined→readonly x?: T):Assemble.Options:viewer,fields,include,includable,targets,depth,concurrency,capabilities.Assemble.CollectionOptions.included,Assemble.UnpaginatedCollectionOptions.query,Assemble.Pagination.query, andAssemble.RelationshipInput'sviewer,capabilities,includedandfields.Assemble.OwnedCapabilitiesOptions:canModerate,relationship.Assemble.edgePage'sinput.query.Handlers.data/collection/linkage/buildIncludedoptions:included,onResource,checkLinkage.Handlers.ResolveIncludedOptions:depth,concurrency.ResourceHandlers.IncludeConfig:depth,concurrency.ResourceHandlers.ReadOnlyConfig:viewer,capabilities,cache,include,maxPageLimit.ResourceHandlers.Config:transact,hiddenWrite.ResourceHandlers.RelatedConfig:includable,listQuery,viewer,capabilities,defaultPageLimit,maxPageLimit,concurrency.ResourceHandlers.GetRequest.queryandRelatedRequest.query: the decoded?include=(Endpoint.FlatGetQuery's type) andoffset/limit, with no| undefined. A request HttpApi decodes from the endpoints still assigns.Document.DataDocument/CollectionDocument/LinkageDocument/Documentoptions:included,meta,error.Document.WireOptions.toManyMeta.Endpoint.FlatDocumentOptions:included,toManyMeta.Endpoint.FlatRelatedOptions:query,included.Group.FlatReadOnlyOptions:filters,toManyMeta.Group.FlatOptions.hiddenWrites.Query.Options:include,fields,sort.Query.FlatListOptions/Query.flatListoptions:filters,include. (pageandfilterchanged with the type-level sentinels, refactor!: prefer-option-over-null, type-level sentinels undefined → never (2 of 6) #627.)FlatQuery.PaginationOptions.defaultLimit.FlatQuery.SlugOptions:maxLength,reserved.FlatQuery.idList'smaxLength.Filter.able'sliteral.Filter.LiteralCodecs'operators.Resource.make/Resource.extendoptions:id,maxUndeclaredMemberErrors.Resource.attribute/readOnlyAttribute'sfilterLiteral.Resource.Any:declaredAttributes,maxUndeclaredMemberErrors.Results and signatures:
Handlers.resolveIncluded(primary, paths, targets, options?)takespaths: Option<ReadonlyArray<string>>(wasReadonlyArray<string> | undefined) and returnsEffect<Option<ReadonlyArray<…>>, …>(was the array orundefined).Option.none()still means "the request carried noinclude".Handlers.withMeta(compute):computereturnsOption<M>(wasM | undefined). ReturnOption.none()for a resource it has nothing to say about.Handlers.project(fields?)/Handlers.project(resource, fields?)take an optionalfields(was a requiredF | undefined).Handlers.Fields' index signature isReadonlyArray<string>(wasReadonlyArray<string> | undefined), as a decodedquery.fieldsis.Assemble.OwnedCapabilitiesOptions.viewerIdreturnsOption<string>(wasstring | undefined).Document.href(link)takes aLinkonly. TheLink | undefinedoverload is gone.Lid.LidMap.idreturnsOption<string>(wasstring | undefined).LidMap.resolveLinkage'srelationshipsis an optional parameter.FlatQuery.suppliedValue(field?)takes an optional parameter.Filter.Annotation.literalandResource.AttributeDescriptor.annotationsare optional members (were requiredT | undefined).Resource.attributeAnnotations(AttributeAnnotationsOf) has no key for an attribute that carries no annotations (was the key set toundefined).Resource.family'smaxUndeclaredMemberErrorson a name-only family is the default cap,12(wasundefined, which the atomic operations read as12). It is typednumber.Migration for the apps:
undefinedis left out rather than set toundefined. Use thedefinedMemberhelper from the migration guide (Migration guide: 0.21 → 0.22 (breaking changes for website, gardeneria, preferenceflow, in-the-dark) #620) and spread one call per key:Handlers.data(article, { ...definedMember("included", included), self }). A value held as anOptiontakes theOptionform of the same helper (someMember).Handlers.resolveIncluded(x, query.include, targets)becomesHandlers.resolveIncluded(x, Option.fromUndefinedOr(query.include), targets). Hand itsOptionresult to the builder withsomeMember("included", included), orOption.matchit.Handlers.withMeta((r) => ({ … }))becomesHandlers.withMeta((r) => Option.some({ … })), and() => undefinedbecomes() => Option.none().viewerId: (v) => v?.idbecomesviewerId: (v) => Option.fromNullishOr(v?.id).Document.href(maybeLink)becomesOption.map(Option.fromUndefinedOr(maybeLink), Document.href). UseOption.getOrUndefinedto keep the old behaviour.lids.id(lid)is anOption:Option.getOrThrowWith(lids.id(lid), () => new Lid.UnknownLidError(lid)), orOption.getOrUndefined.3c74fe9: Breaking: the wire-shape types are spelled from their schemas, and wire members that are optional in JSON:API no longer take an explicit
undefined(part of Move every @enfect/oxlint rule to error #533).Every
| nullin a wire type stays:data: null,links.next: nulland nullable attributes are unchanged, and the respelled types (Handlers.LinkageValue,LinksValue'sfirst/last/prev/next,ResourceValue's relationshipdata,resolveIncluded'sprimary,data's bound;Atomic.RelationshipDataValue,ResultValue.data,result's bound;Lid.RefLinkageValue,ResolvedLinkage;Assemble.RelationshipDocument.data;Client.hydrate'sdata;Resource.attribute/readOnlyAttribute/Filter.able's nullable-schema match) are identical to the old ones. What changes, underexactOptionalPropertyTypes, is that these optional members are now?: T, asSchema.optionalKeydecodes them, not?: T | undefined:Assemble.ResourceLike:relationships,links,links.self,metaAssemble.RelationshipObject:data,links,metaClient.AnyDocument.included,Client.IncludedResource(attributes,relationships,links,meta),Client.DocumentMembers(meta,links,jsonapi),Client.ResourceDocument/CollectionDocumentincluded,Client.LinkedResource.relationships,Client.hydrate'sdocument.includedConformance.WritePayload:attributes,relationships,metaClient.readTotalCount'ssourceis an optional parameter (readTotalCount()andreadTotalCount(undefined)both still give0).A decoded document or resource still assigns as it is. Code that builds one of these values with
{ links: maybeLinks }, wheremaybeLinksmight beundefined, stops compiling: leave the key out when the value is absent, spreading one call per key of thedefinedMemberhelper from the 0.22 migration notes (Migration guide: 0.21 → 0.22 (breaking changes for website, gardeneria, preferenceflow, in-the-dark) #620):68c2b3f:
Assemble.PaginationgainslinkTotalandlastUnknown, andAssemble.edgePage'sinputforwards both.linkTotalis the total the pagination links (last, and whethernextexists) are computed from, defaulting tototalCount;meta.totalCountstaystotalCount.lastUnknown: trueomitslinks.last(the key is absent, notnull) whileself/first/prev/nextstay exact. A search with no corpus count passeslinkTotal = offset + page.length + (hasMore ? 1 : 0)andlastUnknown: true. Additive; no published type changes (LinksValue.lastwas already optional). From gardeneria#1263 O8 (Assemble.edgePage drops the request query from its links; Pagination lacks linkTotal / lastUnknown (gardeneria#1263 O8) #569).06fa426: Breaking: a relationship descriptor's storage
keyand canonicalorderareOptions, no longerT | undefined(prefer-option-over-null: Relationship.StorageKey and Paginated's order need a design decision #626, part of Move every @enfect/oxlint rule to error #533).Relationship.one/optionaldescriptors (Relationship.One,Optional,one,optional) carrykey: Option.Option<K>:Option.some("authorId")when akeyis declared,Option.none()when none is. A declared key still infers its literal (Option<"authorId">); an undeclared one reads asOption<never>.Relationship.paginateddescriptors (Relationship.Paginated,paginated) carryorder: Option.Option<O>the same way, with the declaredconsttuple asOandOption<never>when no order is declared.Relationship.StorageKeyisstring(it wasstring | undefined), andPaginated'sOis constrained byOrder<R>alone. The lowercase annotations default the undeclared parameter tonever, soRelationship.one<Comment>andRelationship.paginated<Comment>still name an unkeyed / order-less descriptor. An explicitundefinedtype argument (Relationship.one<Comment, false, undefined>,Relationship.paginated<Comment, undefined>) is now a constraint error: omit it, or passnever.Relationship.One<Any>,Optional<Any>,Paginated<Any>,Descriptor) still match keyed and unkeyed, ordered and order-less descriptors alike.The wire schema, the query grammar and the endpoints are unchanged. Migration, for apps that derive storage (a table, a sync engine's node graph) or a default sort from the descriptors:
The
keyandorderoptions themselves no longer acceptundefined(they were typedK | undefinedthrough the parameter). UnderexactOptionalPropertyTypes,{ key: maybeKey }/{ order: maybeOrder }is a compile error; pass the key only when it is defined:1348b44: The error funnel can be overridden, and an
ApiError.makeerror no longer repeats itsdetailinmeta(ServerErrors/ApiError: Conflict duplicates detail into meta, and respond can't override a mapping (gardeneria#1263 O1) #565).ServerErrors.RespondOptions.override. These are mapping armsServerErrors.respondconsults beforefromTaggedError, so an application can render a cause the package already maps (anApiError.Conflictin its own wording, say) its own way.nonehands the cause on tofromTaggedErrorand then tomaterialise, which are unchanged.detailfield is encoded only as the error object's top-leveldetail, never also asmeta.detail.new ApiError.Conflict({ detail: "id mismatch" })now encodes as{ status: "409", code: "conflict", title: "Conflict", detail: "id mismatch" }, and everyBadRequesttheSchemaErrorsmiddleware answers loses itsmeta: { detail: "Request query failed validation" }the same way. Other fields still go tometa.meta. AnApiError.makeerror whose fields are all optional and absent (or only thedetailfield) no longer carriesmeta: {}:new ApiError.Conflict({})encodes as{ status: "409", code: "conflict", title: "Conflict" }.detailfield already falls back to the error object'sdetail, so typed clients and the round trip are unaffected.Migration (website, gardeneria, preferenceflow, in-the-dark, and any other consumer): code that reads
errors[].meta.detailreadserrors[].detailinstead, and tests that match an error body exactly dropmeta.detail(andmeta: {}) from the expected body.42dc8e1: Breaking: the schemas this package publishes no longer use
Schema.Number, which acceptsNaN,Infinityand-Infinity. Each is nowSchema.Finiteor, where the value is a count, status or index,Schema.Int(both also reject the non-finite values). Decoding or constructing a value withNaNor an infinity now fails with a schema error, and the emitted declarations nameSchema.Finite/Schema.Intwhere they namedSchema.Number. The accepted values narrowed for:Query.Page.offset(...)andQuery.Page.number(...)withfromString: false: theoffset,limit,numberandsizeleaves build onSchema.Finiteinstead ofSchema.Number(they were already integer-checked and bounded). The defaultfromString: truepath already decoded throughFiniteFromString, so the wire stringsNaN,Infinityand-Infinitywere already refused and the error messages for wire input are unchanged.FlatQuery.PageOffset,FlatQuery.pageLimit(...),FlatQuery.pagination(...)and theDefaultedPagination/RequiredPaginationtypes: now typedSchema.Finite(the runtime schemas fromeffect-ext'sBoundedalready were).ServerErrors.Redirect.status,ServerErrors.HttpError.statusandServerErrors.JsonapiError.status: nowSchema.Int, so a fractional status is refused too.ServerErrors.ValidationFailureissuepathsegments given as numbers: nowSchema.Int(array indices).ApiError.UnsupportedIncludeDepthmaxDepthfield: nowSchema.Int.Client.ErrorResponse.status: nowSchema.Int.Conformance.ContractViolation.remaining: nowSchema.Int.Migration: a handler or client that builds one of these errors or a
fromString: falsepage query from a computed number must pass a finite value (an integer for theSchema.Intfields);Number.isFiniteorMath.truncat the boundary is enough. Code that annotated these schemas asSchema.Number(for exampleconst page: Schema.Number = FlatQuery.PageOffset) should saySchema.Finite. Attribute and meta schemas you declare yourself are unaffected; considerSchema.FiniteoverSchema.Numberthere as well.Patch Changes
Query.schemaoption still throws synchronously with the same message, but the thrown value is an internalDeclarationError(aSchema.TaggedError, soinstanceof Errorstill holds) withnameand_tag"DeclarationError", instead of a bareError.HandlersandApiError.toDocumentmisuse errors andEndpoint.getRelationship's unknown-relationship error are tagged the same way. No class is exported; match onmessageas before.@thomasfosterau/effect-extdependency range widens from^0.1.0to^0.1.0 || ^0.2.0(Accept @thomasfosterau/effect-ext 0.2: the ^0.1.0 dependency range gives apps on 0.2 a nested 0.1.0 copy #585), so an application already on effect-ext 0.2 no longer gets a second, nested 0.1 copy under this package. Nothing this package imports from effect-ext changed incompatibly in 0.2.0, and the test suite now runs against 0.2.0.ServerErrors.schemaIssueToErrorsnow walks a schema issue with@thomasfosterau/effect-ext'sIssues.leaves/Issues.messageinstead of a local copy (chore: drop internal/schemaExt.issueLeaves once effect-ext's Issues carries the nearest Filter down #555). The error objects it renders are unchanged: a struct-level check's message for the fields it points at, with no appended path. The effect-ext dependency floor moves to^0.2.0, the release that carries that walk.meta,attributes,relationshipsandlinksobjects of the wire-shape types (Assemble.WireResource,Assemble.ResourceDocument,Handlers.MetaValue,Clientcreate/update inputs,Client.readTotalCount, …) andFilter.FieldTypesare now spelledReadonlyRecord<string, unknown>fromeffect/Recordinstead of a hand-written index signature. The types are identical, so no migration is needed;Filter.FieldTypesis now a type alias rather than an interface.