diff --git a/src/body.ts b/src/body.ts index cf112fc..5e75a38 100644 --- a/src/body.ts +++ b/src/body.ts @@ -15,7 +15,9 @@ export type JsonApiError = { meta?: Meta; }; -type TopLevelLinks = Links<"self" | "related" | "describedby" | "first" | "last" | "prev" | "next">; +export type TopLevelLinks = Links< + "self" | "related" | "describedby" | "first" | "last" | "prev" | "next" +>; type OptionalTopLevelMembers = { links?: TopLevelLinks; diff --git a/src/serializer.ts b/src/serializer.ts index 66605d1..492f4de 100644 --- a/src/serializer.ts +++ b/src/serializer.ts @@ -1,4 +1,4 @@ -import { JsonApiBody } from "./body.js"; +import { JsonApiBody, type TopLevelLinks } from "./body.js"; import type { Attributes, Links, @@ -99,7 +99,7 @@ export type SerializeManagerOptions; include?: string[]; meta?: Meta; - links?: Links; + links?: TopLevelLinks; extensions?: string[]; profiles?: string[]; sideloaded?: TSideloaded; @@ -178,6 +178,7 @@ export class SerializeManager< { data, meta: options?.meta, + links: options?.links, included: included?.toJson(), }, {