@haddowg/json-api-client 1.9.0 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -39,13 +39,14 @@ const client = createClient({
39
39
 
40
40
  `ClientOptions`:
41
41
 
42
- | Option | Type | Notes |
43
- | ----------- | ------------------------------------------- | ------------------------------------------------------------ |
44
- | `baseUrl` | `string` | Base URL the generated path templates resolve against. |
45
- | `transport` | `(req) => Promise<res>` | The transport seam; defaults to a `fetch` adapter. |
46
- | `headers` | `() => HeadersInit \| Promise<HeadersInit>` | Per-request header provider (bearer auth, etc.). |
47
- | `atomic` | `AtomicDescriptor \| null` | Atomic endpoint; the generated `createClient` threads it in. |
48
- | `validate` | `ValidationOption` | Opt-in per-field validation seam (off by default). |
42
+ | Option | Type | Notes |
43
+ | ----------------------- | ------------------------------------------- | -------------------------------------------------------------------------------------------- |
44
+ | `baseUrl` | `string` | Base URL the generated path templates resolve against. |
45
+ | `transport` | `(req) => Promise<res>` | The transport seam; defaults to a `fetch` adapter. |
46
+ | `headers` | `() => HeadersInit \| Promise<HeadersInit>` | Per-request header provider (bearer auth, etc.). |
47
+ | `allowCrossOriginLinks` | `boolean` | Follow a `$next()`/`$prev()` link to another origin, sent without `headers`. Off by default. |
48
+ | `atomic` | `AtomicDescriptor \| null` | Atomic endpoint; the generated `createClient` threads it in. |
49
+ | `validate` | `ValidationOption` | Opt-in per-field validation seam (off by default). |
49
50
 
50
51
  ## Reads
51
52
 
@@ -65,7 +66,7 @@ const albums = await client.albums.list({
65
66
 
66
67
  albums[0]!.title // string
67
68
  albums[0]!.artist?.name // hydrated artist resource (its attributes are typed)
68
- albums.$page.kind // 'page' | 'offset' | 'cursor' | 'none'
69
+ albums.$page.kind // 'page' (typed from the descriptor's paginator)
69
70
  albums.$meta?.['page'] // raw top-level meta
70
71
  ```
71
72
 
package/dist/ajv.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as Validator, n as SchemaMap } from "./validate-CvUPfKwB.cjs";
1
+ import { a as Validator, n as SchemaMap } from "./validate-BLXEfy75.cjs";
2
2
  import { ValidateFunction } from "ajv";
3
3
 
4
4
  //#region src/ajv.d.ts
package/dist/ajv.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as Validator, n as SchemaMap } from "./validate-CvUPfKwB.mjs";
1
+ import { a as Validator, n as SchemaMap } from "./validate-BLXEfy75.mjs";
2
2
  import { ValidateFunction } from "ajv";
3
3
 
4
4
  //#region src/ajv.d.ts
package/dist/index.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  //#region src/errors.ts
3
3
  /**
4
- * Thrown by the always-on light structural guards (ADR 0004) when a parsed response is not a
4
+ * Thrown by the always-on light structural guards when a parsed response is not a
5
5
  * JSON:API document, or a `data`/`included` member is not a resource object carrying `type`+`id`.
6
6
  * Distinct from {@link JsonApiError} (a non-2xx server response): this signals the wire shape the
7
7
  * runtime relies on was violated, not an application error the server reported. The opt-in
@@ -231,7 +231,7 @@ const defineGetter = (target, key, get) => {
231
231
  });
232
232
  };
233
233
  /**
234
- * Materialise a JSON:API document into a hydrated graph (ADR 0002 / CONTEXT.md):
234
+ * Materialise a JSON:API document into a hydrated graph (ADR 0002):
235
235
  *
236
236
  * - single resource -> a flattened resource object (own enumerable type/id/attributes/
237
237
  * relations + non-enumerable `$`-accessors);
@@ -357,7 +357,7 @@ function attachResourceEnvelope(node, raw, env, rels) {
357
357
  * edge-local `$edge`/`$pivot`. Identity is by `type:id`, never reference.
358
358
  *
359
359
  * `relationEdge` (set for a to-one) carries the relationship object's self/related links and
360
- * meta, which ride the value's `$edge` per CONTEXT.md.
360
+ * meta, which ride the value's `$edge` (docs/materialisation.md).
361
361
  */
362
362
  function buildEdgeView(node, member, relationEdge) {
363
363
  const view = {};
@@ -576,7 +576,7 @@ const isPlainObject$1 = (value) => typeof value === "object" && value !== null &
576
576
  * value — a `Range`/`DateRange` deepObject (`{ min, max }`) — and recurses into nested bracketed
577
577
  * keys (`filter[k][min]=`), matching the server's deepObject wire shape; an array joins with `,`;
578
578
  * a scalar is appended directly. Without the object branch a `{ min, max }` value would reach the
579
- * wire as `filter[k]=[object Object]` and be silently ignored by the server (D23).
579
+ * wire as `filter[k]=[object Object]` and be silently ignored by the server.
580
580
  */
581
581
  const appendFilterValue = (parts, key, value) => {
582
582
  if (isPlainObject$1(value)) {
@@ -793,7 +793,7 @@ const describe = (value) => value === null ? "null" : Array.isArray(value) ? "an
793
793
  * - `/data/relationships/orderedTracks/data/0/meta/pivot/position` -> `orderedTracks[0].$pivot.position`
794
794
  *
795
795
  * Pivot values nest under a member's `meta.pivot` (symmetric with reads — see
796
- * `JsonPointerBuilder::forLinkageMeta` / bundle ADR 0103), so a `meta/pivot/<field>` tail on
796
+ * `JsonPointerBuilder::forLinkageMeta`), so a `meta/pivot/<field>` tail on
797
797
  * a member of a pivot-bearing to-many is surfaced as `.$pivot.<field>`.
798
798
  *
799
799
  * A query-side pointer is left untouched (those are already user-facing — see
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as ReadResult, $t as CANONICAL_PAGE_KEYS, A as BinaryBody, An as PaginatorStrategy, At as AtomicUpdateInput, B as ErrorCodeOf, Bt as DocumentEnvelope, C as TransportRawBody, Cn as InputMediaKind, Ct as AtomicDeleteHandle, D as ActionCallOptions, Dn as PaginatorDescriptor, Dt as AtomicResult, E as fetchTransport, En as OperationExamples, Et as AtomicRef, F as CreateInput, Fn as RelationMutations, Ft as LocalIdentifier, G as HydratedMember, Gt as MaterialiseContext, H as FieldsMap, Ht as EdgeEnvelope, I as DefaultActionTypes, In as ResourceDescriptor, It as MediaTypeParams, J as IncludedRelations, Jt as ResourceEnvelope, K as IdentifierMember, Kt as NavigateOptions, L as DefaultAttributes, Ln as ResourceExamples, Lt as ResourceIdentifier, M as Client, Mn as RawMediaKind, Mt as ATOMIC_EXT, N as Collection, Nn as RawOutputMedia, Nt as ATOMIC_MEDIA_TYPE, O as ActionsAccessor, On as PaginatorKind, Ot as AtomicResults, P as CountToken, Pn as RelationDescriptor, Pt as JSON_API_MEDIA_TYPE, Q as PivotInput, Qt as relatedPaginatorKind, R as DefaultWriteAttributes, Rn as StrategyDescriptor, Rt as mediaType, S as JsonApiTransport, Sn as InputMedia, St as AtomicCreateInput, T as TransportResponse, Tn as MenuDescriptor, Tt as AtomicRecorder, U as FilterKey, Ut as Link, V as FieldSelectionMap, Vt as Edge, W as FilterQuery, Wt as LinkObject, X as ListPageParams, Xt as materialise, Y as LinkageRef, Yt as ResourceLinks, Z as MemberName, Zt as relatedPaginator, _ as serializeQuery, _n as ApiExamples, _t as WriteOptions, a as Validator, an as PageOf, at as RelationshipAccessor, b as HeadersInit, bn as ClientIdPolicy, bt as readActionLocation, c as resolveValidator, cn as ResolvedPaginator, ct as ResourceObjectView, d as JsonApiContext, dn as ActionDescriptor, dt as SortToken, en as ExactPageParams, et as ReadableRelationName, f as JsonApiRequest, fn as ActionInput, ft as TypeAccessor, g as executeRaw, gn as ApiDescriptor, gt as WithLinks, h as execute, hn as ActionScope, ht as UpdateInput, i as ValidationOption, in as PageMeta, it as RelationReadQuery, j as BinaryResponseType, jn as PivotDescriptor, jt as runAtomic, k as AtomicResultOf, kn as PaginatorRole, kt as AtomicUpdateHandle, l as validateDocument, ln as TypedPage, lt as SingleReadQuery, m as ReadQuery, mn as ActionOutput, mt as TypedReadQuery, n as SchemaMap, nn as PageKeys, nt as RelationPageParams, o as WireResource, on as PageParams, ot as ResourceAccessors, p as RawResponseType, pn as ActionLocationDescriptor, pt as TypeName, q as IncludePath, qt as RelationView, r as ValidationConfig, rn as PageLinks, rt as RelationPaginator, s as assertJsonApiDocument, sn as PageParamsOf, st as ResourceHandle, t as ResolvedValidator, tn as Page, tt as RelationName, u as Document, un as resolvePaginator, ut as SortQuery, v as ClientOptions, vn as AtomicDescriptor, vt as ActionLocation, w as TransportRequest, wn as MediaExamples, wt as AtomicHandle, x as createClient, xn as CountableDescriptor, xt as AtomicCreateHandle, y as HANDLE_RESERVED, yn as Cardinality, yt as isActionLocation, z as EdgeMembers, zn as isPolymorphic, zt as ArrayEnvelope } from "./validate-CvUPfKwB.cjs";
1
+ import { $ as MemberName, $t as ResourceLinks, A as BinaryBody, An as OperationExamples, At as AtomicRef, B as ErrorCodeOf, Bn as ResourceDescriptor, Bt as MediaTypeParams, C as TransportRawBody, Cn as Cardinality, Ct as isActionLocation, D as ActionCallOptions, Dn as InputMediaKind, Dt as AtomicDeleteHandle, E as fetchTransport, En as InputMedia, Et as AtomicCreateInput, F as CreateInput, Fn as PivotDescriptor, Ft as runAtomic, G as HydratedMember, Gt as Edge, H as FieldsMap, Hn as StrategyDescriptor, Ht as mediaType, I as DefaultActionTypes, In as RawMediaKind, It as ATOMIC_EXT, J as IncludedRelations, Jt as LinkObject, K as IdentifierMember, Kt as EdgeEnvelope, L as DefaultAttributes, Ln as RawOutputMedia, Lt as ATOMIC_MEDIA_TYPE, M as Client, Mn as PaginatorKind, Mt as AtomicResults, N as Collection, Nn as PaginatorRole, Nt as AtomicUpdateHandle, O as ActionsAccessor, On as MediaExamples, Ot as AtomicHandle, P as CountToken, Pn as PaginatorStrategy, Pt as AtomicUpdateInput, Q as ListPageParams, Qt as ResourceEnvelope, R as DefaultWriteAttributes, Rn as RelationDescriptor, Rt as JSON_API_MEDIA_TYPE, S as JsonApiTransport, Sn as AtomicDescriptor, St as ActionLocation, T as TransportResponse, Tn as CountableDescriptor, Tt as AtomicCreateHandle, U as FilterKey, Un as isPolymorphic, Ut as ArrayEnvelope, V as FieldSelectionMap, Vn as ResourceExamples, Vt as ResourceIdentifier, W as FilterQuery, Wt as DocumentEnvelope, X as IncludedType, Xt as NavigateOptions, Y as IncludedResource, Yt as MaterialiseContext, Z as LinkageRef, Zt as RelationView, _ as serializeQuery, _n as ActionLocationDescriptor, _t as TypeName, a as Validator, an as Page, at as RelationName, b as HeadersInit, bn as ApiDescriptor, bt as WithLinks, c as resolveValidator, cn as PageMeta, ct as RelationReadQuery, d as JsonApiContext, dn as PageParamsOf, dt as ResourceHandle, en as materialise, et as PivotInput, f as JsonApiRequest, fn as ResolvedPaginator, ft as ResourceObjectView, g as executeRaw, gn as ActionInput, gt as TypeAccessor, h as execute, hn as ActionDescriptor, ht as SortToken, i as ValidationOption, in as ExactPageParams, it as RelatedIncludedType, j as BinaryResponseType, jn as PaginatorDescriptor, jt as AtomicResult, k as AtomicResultOf, kn as MenuDescriptor, kt as AtomicRecorder, l as validateDocument, ln as PageOf, lt as RelationshipAccessor, m as ReadQuery, mn as resolvePaginator, mt as SortQuery, n as SchemaMap, nn as relatedPaginatorKind, nt as ReadableRelationName, o as WireResource, on as PageKeys, ot as RelationPageParams, p as RawResponseType, pn as TypedPage, pt as SingleReadQuery, q as IncludePath, qt as Link, r as ValidationConfig, rn as CANONICAL_PAGE_KEYS, rt as RelatedIncludedResource, s as assertJsonApiDocument, sn as PageLinks, st as RelationPaginator, t as ResolvedValidator, tn as relatedPaginator, tt as ReadResult, u as Document, un as PageParams, ut as ResourceAccessors, v as ClientOptions, vn as ActionOutput, vt as TypedReadQuery, w as TransportRequest, wn as ClientIdPolicy, wt as readActionLocation, x as createClient, xn as ApiExamples, xt as WriteOptions, y as HANDLE_RESERVED, yn as ActionScope, yt as UpdateInput, z as EdgeMembers, zn as RelationMutations, zt as LocalIdentifier } from "./validate-BLXEfy75.cjs";
2
2
 
3
3
  //#region src/errors.d.ts
4
4
  /**
@@ -23,7 +23,7 @@ interface JsonApiErrorObject<C extends string = string> {
23
23
  /**
24
24
  * The user-facing input path, remapped from `source.pointer` for write errors
25
25
  * (e.g. `/data/attributes/title` -> `title`). Populated by the runtime, which
26
- * built the envelope and therefore knows the inverse mapping. See CONTEXT.md.
26
+ * built the envelope and therefore knows the inverse mapping. See docs/errors.md.
27
27
  */
28
28
  path?: string;
29
29
  /**
@@ -34,7 +34,7 @@ interface JsonApiErrorObject<C extends string = string> {
34
34
  opIndex?: number;
35
35
  }
36
36
  /**
37
- * Thrown by the always-on light structural guards (ADR 0004) when a parsed response is not a
37
+ * Thrown by the always-on light structural guards when a parsed response is not a
38
38
  * JSON:API document, or a `data`/`included` member is not a resource object carrying `type`+`id`.
39
39
  * Distinct from {@link JsonApiError} (a non-2xx server response): this signals the wire shape the
40
40
  * runtime relies on was violated, not an application error the server reported. The opt-in
@@ -163,7 +163,7 @@ declare function toRelationshipDocument(refs: unknown, cardinality: 'one' | 'man
163
163
  * - `/data/relationships/orderedTracks/data/0/meta/pivot/position` -> `orderedTracks[0].$pivot.position`
164
164
  *
165
165
  * Pivot values nest under a member's `meta.pivot` (symmetric with reads — see
166
- * `JsonPointerBuilder::forLinkageMeta` / bundle ADR 0103), so a `meta/pivot/<field>` tail on
166
+ * `JsonPointerBuilder::forLinkageMeta`), so a `meta/pivot/<field>` tail on
167
167
  * a member of a pivot-bearing to-many is surfaced as `.$pivot.<field>`.
168
168
  *
169
169
  * A query-side pointer is left untouched (those are already user-facing — see
@@ -216,5 +216,5 @@ declare function withRemappedRelationshipPaths(error: JsonApiError, rel: string,
216
216
  */
217
217
  declare function withRemappedAtomicPaths(error: JsonApiError, descriptor: ApiDescriptor, typeForOp: (opIndex: number) => string | undefined): JsonApiError;
218
218
  //#endregion
219
- export { ATOMIC_EXT, ATOMIC_MEDIA_TYPE, ActionCallOptions, ActionDescriptor, ActionInput, ActionLocation, ActionLocationDescriptor, ActionOutput, ActionScope, ActionsAccessor, ApiDescriptor, ApiExamples, ArrayEnvelope, AtomicCreateHandle, AtomicCreateInput, AtomicDeleteHandle, AtomicDescriptor, AtomicHandle, AtomicRecorder, AtomicRef, AtomicResult, AtomicResultOf, AtomicResults, AtomicUpdateHandle, AtomicUpdateInput, BinaryBody, BinaryResponseType, CANONICAL_PAGE_KEYS, Cardinality, Client, ClientIdPolicy, ClientOptions, Collection, CountToken, CountableDescriptor, CreateInput, DefaultActionTypes, DefaultAttributes, DefaultWriteAttributes, Document, DocumentEnvelope, Edge, EdgeEnvelope, EdgeMembers, ErrorCodeGuard, ErrorCodeOf, ExactPageParams, FieldSelectionMap, FieldsMap, FilterKey, FilterQuery, HANDLE_RESERVED, HeadersInit, HydratedMember, IdentifierMember, IncludePath, IncludedRelations, InputMedia, InputMediaKind, JSON_API_MEDIA_TYPE, JsonApiContext, JsonApiError, JsonApiErrorObject, JsonApiRequest, JsonApiTransport, Link, LinkObject, LinkageRef, ListPageParams, LocalIdentifier, MaterialiseContext, MediaExamples, MediaTypeParams, MemberName, MenuDescriptor, NavigateOptions, OperationExamples, Page, PageKeys, PageLinks, PageMeta, PageOf, PageParams, PageParamsOf, PaginatorDescriptor, PaginatorKind, PaginatorRole, PaginatorStrategy, PivotDescriptor, PivotInput, RawMediaKind, RawOutputMedia, RawResponseType, ReadQuery, ReadResult, ReadableRelationName, RelationDescriptor, RelationMutations, RelationName, RelationPageParams, RelationPaginator, RelationReadQuery, RelationView, RelationshipAccessor, RelationshipDocument, ResolvedPaginator, ResolvedValidator, ResourceAccessors, ResourceDescriptor, ResourceEnvelope, ResourceExamples, ResourceHandle, ResourceIdentifier, ResourceLinks, ResourceObjectView, SchemaMap, SingleReadQuery, SortQuery, SortToken, StrategyDescriptor, StructuralGuardError, ToDocumentOptions, TransportRawBody, TransportRequest, TransportResponse, TypeAccessor, TypeName, TypedPage, TypedReadQuery, UpdateInput, ValidationConfig, ValidationOption, Validator, WireResource, WithLinks, WriteDocument, WriteOptions, assertJsonApiDocument, createClient, execute, executeRaw, fetchTransport, hasErrorCode, isActionLocation, isPolymorphic, materialise, mediaType, readActionLocation, relatedPaginator, relatedPaginatorKind, remapPointer, remapRelationshipPointer, resolvePaginator, resolveValidator, runAtomic, serializeQuery, toDocument, toRelationshipDocument, validateDocument, withRemappedAtomicPaths, withRemappedPaths, withRemappedRelationshipPaths };
219
+ export { ATOMIC_EXT, ATOMIC_MEDIA_TYPE, ActionCallOptions, ActionDescriptor, ActionInput, ActionLocation, ActionLocationDescriptor, ActionOutput, ActionScope, ActionsAccessor, ApiDescriptor, ApiExamples, ArrayEnvelope, AtomicCreateHandle, AtomicCreateInput, AtomicDeleteHandle, AtomicDescriptor, AtomicHandle, AtomicRecorder, AtomicRef, AtomicResult, AtomicResultOf, AtomicResults, AtomicUpdateHandle, AtomicUpdateInput, BinaryBody, BinaryResponseType, CANONICAL_PAGE_KEYS, Cardinality, Client, ClientIdPolicy, ClientOptions, Collection, CountToken, CountableDescriptor, CreateInput, DefaultActionTypes, DefaultAttributes, DefaultWriteAttributes, Document, DocumentEnvelope, Edge, EdgeEnvelope, EdgeMembers, ErrorCodeGuard, ErrorCodeOf, ExactPageParams, FieldSelectionMap, FieldsMap, FilterKey, FilterQuery, HANDLE_RESERVED, HeadersInit, HydratedMember, IdentifierMember, IncludePath, IncludedRelations, IncludedResource, IncludedType, InputMedia, InputMediaKind, JSON_API_MEDIA_TYPE, JsonApiContext, JsonApiError, JsonApiErrorObject, JsonApiRequest, JsonApiTransport, Link, LinkObject, LinkageRef, ListPageParams, LocalIdentifier, MaterialiseContext, MediaExamples, MediaTypeParams, MemberName, MenuDescriptor, NavigateOptions, OperationExamples, Page, PageKeys, PageLinks, PageMeta, PageOf, PageParams, PageParamsOf, PaginatorDescriptor, PaginatorKind, PaginatorRole, PaginatorStrategy, PivotDescriptor, PivotInput, RawMediaKind, RawOutputMedia, RawResponseType, ReadQuery, ReadResult, ReadableRelationName, RelatedIncludedResource, RelatedIncludedType, RelationDescriptor, RelationMutations, RelationName, RelationPageParams, RelationPaginator, RelationReadQuery, RelationView, RelationshipAccessor, RelationshipDocument, ResolvedPaginator, ResolvedValidator, ResourceAccessors, ResourceDescriptor, ResourceEnvelope, ResourceExamples, ResourceHandle, ResourceIdentifier, ResourceLinks, ResourceObjectView, SchemaMap, SingleReadQuery, SortQuery, SortToken, StrategyDescriptor, StructuralGuardError, ToDocumentOptions, TransportRawBody, TransportRequest, TransportResponse, TypeAccessor, TypeName, TypedPage, TypedReadQuery, UpdateInput, ValidationConfig, ValidationOption, Validator, WireResource, WithLinks, WriteDocument, WriteOptions, assertJsonApiDocument, createClient, execute, executeRaw, fetchTransport, hasErrorCode, isActionLocation, isPolymorphic, materialise, mediaType, readActionLocation, relatedPaginator, relatedPaginatorKind, remapPointer, remapRelationshipPointer, resolvePaginator, resolveValidator, runAtomic, serializeQuery, toDocument, toRelationshipDocument, validateDocument, withRemappedAtomicPaths, withRemappedPaths, withRemappedRelationshipPaths };
220
220
  //# sourceMappingURL=index.d.cts.map
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as ReadResult, $t as CANONICAL_PAGE_KEYS, A as BinaryBody, An as PaginatorStrategy, At as AtomicUpdateInput, B as ErrorCodeOf, Bt as DocumentEnvelope, C as TransportRawBody, Cn as InputMediaKind, Ct as AtomicDeleteHandle, D as ActionCallOptions, Dn as PaginatorDescriptor, Dt as AtomicResult, E as fetchTransport, En as OperationExamples, Et as AtomicRef, F as CreateInput, Fn as RelationMutations, Ft as LocalIdentifier, G as HydratedMember, Gt as MaterialiseContext, H as FieldsMap, Ht as EdgeEnvelope, I as DefaultActionTypes, In as ResourceDescriptor, It as MediaTypeParams, J as IncludedRelations, Jt as ResourceEnvelope, K as IdentifierMember, Kt as NavigateOptions, L as DefaultAttributes, Ln as ResourceExamples, Lt as ResourceIdentifier, M as Client, Mn as RawMediaKind, Mt as ATOMIC_EXT, N as Collection, Nn as RawOutputMedia, Nt as ATOMIC_MEDIA_TYPE, O as ActionsAccessor, On as PaginatorKind, Ot as AtomicResults, P as CountToken, Pn as RelationDescriptor, Pt as JSON_API_MEDIA_TYPE, Q as PivotInput, Qt as relatedPaginatorKind, R as DefaultWriteAttributes, Rn as StrategyDescriptor, Rt as mediaType, S as JsonApiTransport, Sn as InputMedia, St as AtomicCreateInput, T as TransportResponse, Tn as MenuDescriptor, Tt as AtomicRecorder, U as FilterKey, Ut as Link, V as FieldSelectionMap, Vt as Edge, W as FilterQuery, Wt as LinkObject, X as ListPageParams, Xt as materialise, Y as LinkageRef, Yt as ResourceLinks, Z as MemberName, Zt as relatedPaginator, _ as serializeQuery, _n as ApiExamples, _t as WriteOptions, a as Validator, an as PageOf, at as RelationshipAccessor, b as HeadersInit, bn as ClientIdPolicy, bt as readActionLocation, c as resolveValidator, cn as ResolvedPaginator, ct as ResourceObjectView, d as JsonApiContext, dn as ActionDescriptor, dt as SortToken, en as ExactPageParams, et as ReadableRelationName, f as JsonApiRequest, fn as ActionInput, ft as TypeAccessor, g as executeRaw, gn as ApiDescriptor, gt as WithLinks, h as execute, hn as ActionScope, ht as UpdateInput, i as ValidationOption, in as PageMeta, it as RelationReadQuery, j as BinaryResponseType, jn as PivotDescriptor, jt as runAtomic, k as AtomicResultOf, kn as PaginatorRole, kt as AtomicUpdateHandle, l as validateDocument, ln as TypedPage, lt as SingleReadQuery, m as ReadQuery, mn as ActionOutput, mt as TypedReadQuery, n as SchemaMap, nn as PageKeys, nt as RelationPageParams, o as WireResource, on as PageParams, ot as ResourceAccessors, p as RawResponseType, pn as ActionLocationDescriptor, pt as TypeName, q as IncludePath, qt as RelationView, r as ValidationConfig, rn as PageLinks, rt as RelationPaginator, s as assertJsonApiDocument, sn as PageParamsOf, st as ResourceHandle, t as ResolvedValidator, tn as Page, tt as RelationName, u as Document, un as resolvePaginator, ut as SortQuery, v as ClientOptions, vn as AtomicDescriptor, vt as ActionLocation, w as TransportRequest, wn as MediaExamples, wt as AtomicHandle, x as createClient, xn as CountableDescriptor, xt as AtomicCreateHandle, y as HANDLE_RESERVED, yn as Cardinality, yt as isActionLocation, z as EdgeMembers, zn as isPolymorphic, zt as ArrayEnvelope } from "./validate-CvUPfKwB.mjs";
1
+ import { $ as MemberName, $t as ResourceLinks, A as BinaryBody, An as OperationExamples, At as AtomicRef, B as ErrorCodeOf, Bn as ResourceDescriptor, Bt as MediaTypeParams, C as TransportRawBody, Cn as Cardinality, Ct as isActionLocation, D as ActionCallOptions, Dn as InputMediaKind, Dt as AtomicDeleteHandle, E as fetchTransport, En as InputMedia, Et as AtomicCreateInput, F as CreateInput, Fn as PivotDescriptor, Ft as runAtomic, G as HydratedMember, Gt as Edge, H as FieldsMap, Hn as StrategyDescriptor, Ht as mediaType, I as DefaultActionTypes, In as RawMediaKind, It as ATOMIC_EXT, J as IncludedRelations, Jt as LinkObject, K as IdentifierMember, Kt as EdgeEnvelope, L as DefaultAttributes, Ln as RawOutputMedia, Lt as ATOMIC_MEDIA_TYPE, M as Client, Mn as PaginatorKind, Mt as AtomicResults, N as Collection, Nn as PaginatorRole, Nt as AtomicUpdateHandle, O as ActionsAccessor, On as MediaExamples, Ot as AtomicHandle, P as CountToken, Pn as PaginatorStrategy, Pt as AtomicUpdateInput, Q as ListPageParams, Qt as ResourceEnvelope, R as DefaultWriteAttributes, Rn as RelationDescriptor, Rt as JSON_API_MEDIA_TYPE, S as JsonApiTransport, Sn as AtomicDescriptor, St as ActionLocation, T as TransportResponse, Tn as CountableDescriptor, Tt as AtomicCreateHandle, U as FilterKey, Un as isPolymorphic, Ut as ArrayEnvelope, V as FieldSelectionMap, Vn as ResourceExamples, Vt as ResourceIdentifier, W as FilterQuery, Wt as DocumentEnvelope, X as IncludedType, Xt as NavigateOptions, Y as IncludedResource, Yt as MaterialiseContext, Z as LinkageRef, Zt as RelationView, _ as serializeQuery, _n as ActionLocationDescriptor, _t as TypeName, a as Validator, an as Page, at as RelationName, b as HeadersInit, bn as ApiDescriptor, bt as WithLinks, c as resolveValidator, cn as PageMeta, ct as RelationReadQuery, d as JsonApiContext, dn as PageParamsOf, dt as ResourceHandle, en as materialise, et as PivotInput, f as JsonApiRequest, fn as ResolvedPaginator, ft as ResourceObjectView, g as executeRaw, gn as ActionInput, gt as TypeAccessor, h as execute, hn as ActionDescriptor, ht as SortToken, i as ValidationOption, in as ExactPageParams, it as RelatedIncludedType, j as BinaryResponseType, jn as PaginatorDescriptor, jt as AtomicResult, k as AtomicResultOf, kn as MenuDescriptor, kt as AtomicRecorder, l as validateDocument, ln as PageOf, lt as RelationshipAccessor, m as ReadQuery, mn as resolvePaginator, mt as SortQuery, n as SchemaMap, nn as relatedPaginatorKind, nt as ReadableRelationName, o as WireResource, on as PageKeys, ot as RelationPageParams, p as RawResponseType, pn as TypedPage, pt as SingleReadQuery, q as IncludePath, qt as Link, r as ValidationConfig, rn as CANONICAL_PAGE_KEYS, rt as RelatedIncludedResource, s as assertJsonApiDocument, sn as PageLinks, st as RelationPaginator, t as ResolvedValidator, tn as relatedPaginator, tt as ReadResult, u as Document, un as PageParams, ut as ResourceAccessors, v as ClientOptions, vn as ActionOutput, vt as TypedReadQuery, w as TransportRequest, wn as ClientIdPolicy, wt as readActionLocation, x as createClient, xn as ApiExamples, xt as WriteOptions, y as HANDLE_RESERVED, yn as ActionScope, yt as UpdateInput, z as EdgeMembers, zn as RelationMutations, zt as LocalIdentifier } from "./validate-BLXEfy75.mjs";
2
2
 
3
3
  //#region src/errors.d.ts
4
4
  /**
@@ -23,7 +23,7 @@ interface JsonApiErrorObject<C extends string = string> {
23
23
  /**
24
24
  * The user-facing input path, remapped from `source.pointer` for write errors
25
25
  * (e.g. `/data/attributes/title` -> `title`). Populated by the runtime, which
26
- * built the envelope and therefore knows the inverse mapping. See CONTEXT.md.
26
+ * built the envelope and therefore knows the inverse mapping. See docs/errors.md.
27
27
  */
28
28
  path?: string;
29
29
  /**
@@ -34,7 +34,7 @@ interface JsonApiErrorObject<C extends string = string> {
34
34
  opIndex?: number;
35
35
  }
36
36
  /**
37
- * Thrown by the always-on light structural guards (ADR 0004) when a parsed response is not a
37
+ * Thrown by the always-on light structural guards when a parsed response is not a
38
38
  * JSON:API document, or a `data`/`included` member is not a resource object carrying `type`+`id`.
39
39
  * Distinct from {@link JsonApiError} (a non-2xx server response): this signals the wire shape the
40
40
  * runtime relies on was violated, not an application error the server reported. The opt-in
@@ -163,7 +163,7 @@ declare function toRelationshipDocument(refs: unknown, cardinality: 'one' | 'man
163
163
  * - `/data/relationships/orderedTracks/data/0/meta/pivot/position` -> `orderedTracks[0].$pivot.position`
164
164
  *
165
165
  * Pivot values nest under a member's `meta.pivot` (symmetric with reads — see
166
- * `JsonPointerBuilder::forLinkageMeta` / bundle ADR 0103), so a `meta/pivot/<field>` tail on
166
+ * `JsonPointerBuilder::forLinkageMeta`), so a `meta/pivot/<field>` tail on
167
167
  * a member of a pivot-bearing to-many is surfaced as `.$pivot.<field>`.
168
168
  *
169
169
  * A query-side pointer is left untouched (those are already user-facing — see
@@ -216,5 +216,5 @@ declare function withRemappedRelationshipPaths(error: JsonApiError, rel: string,
216
216
  */
217
217
  declare function withRemappedAtomicPaths(error: JsonApiError, descriptor: ApiDescriptor, typeForOp: (opIndex: number) => string | undefined): JsonApiError;
218
218
  //#endregion
219
- export { ATOMIC_EXT, ATOMIC_MEDIA_TYPE, ActionCallOptions, ActionDescriptor, ActionInput, ActionLocation, ActionLocationDescriptor, ActionOutput, ActionScope, ActionsAccessor, ApiDescriptor, ApiExamples, ArrayEnvelope, AtomicCreateHandle, AtomicCreateInput, AtomicDeleteHandle, AtomicDescriptor, AtomicHandle, AtomicRecorder, AtomicRef, AtomicResult, AtomicResultOf, AtomicResults, AtomicUpdateHandle, AtomicUpdateInput, BinaryBody, BinaryResponseType, CANONICAL_PAGE_KEYS, Cardinality, Client, ClientIdPolicy, ClientOptions, Collection, CountToken, CountableDescriptor, CreateInput, DefaultActionTypes, DefaultAttributes, DefaultWriteAttributes, Document, DocumentEnvelope, Edge, EdgeEnvelope, EdgeMembers, ErrorCodeGuard, ErrorCodeOf, ExactPageParams, FieldSelectionMap, FieldsMap, FilterKey, FilterQuery, HANDLE_RESERVED, HeadersInit, HydratedMember, IdentifierMember, IncludePath, IncludedRelations, InputMedia, InputMediaKind, JSON_API_MEDIA_TYPE, JsonApiContext, JsonApiError, JsonApiErrorObject, JsonApiRequest, JsonApiTransport, Link, LinkObject, LinkageRef, ListPageParams, LocalIdentifier, MaterialiseContext, MediaExamples, MediaTypeParams, MemberName, MenuDescriptor, NavigateOptions, OperationExamples, Page, PageKeys, PageLinks, PageMeta, PageOf, PageParams, PageParamsOf, PaginatorDescriptor, PaginatorKind, PaginatorRole, PaginatorStrategy, PivotDescriptor, PivotInput, RawMediaKind, RawOutputMedia, RawResponseType, ReadQuery, ReadResult, ReadableRelationName, RelationDescriptor, RelationMutations, RelationName, RelationPageParams, RelationPaginator, RelationReadQuery, RelationView, RelationshipAccessor, RelationshipDocument, ResolvedPaginator, ResolvedValidator, ResourceAccessors, ResourceDescriptor, ResourceEnvelope, ResourceExamples, ResourceHandle, ResourceIdentifier, ResourceLinks, ResourceObjectView, SchemaMap, SingleReadQuery, SortQuery, SortToken, StrategyDescriptor, StructuralGuardError, ToDocumentOptions, TransportRawBody, TransportRequest, TransportResponse, TypeAccessor, TypeName, TypedPage, TypedReadQuery, UpdateInput, ValidationConfig, ValidationOption, Validator, WireResource, WithLinks, WriteDocument, WriteOptions, assertJsonApiDocument, createClient, execute, executeRaw, fetchTransport, hasErrorCode, isActionLocation, isPolymorphic, materialise, mediaType, readActionLocation, relatedPaginator, relatedPaginatorKind, remapPointer, remapRelationshipPointer, resolvePaginator, resolveValidator, runAtomic, serializeQuery, toDocument, toRelationshipDocument, validateDocument, withRemappedAtomicPaths, withRemappedPaths, withRemappedRelationshipPaths };
219
+ export { ATOMIC_EXT, ATOMIC_MEDIA_TYPE, ActionCallOptions, ActionDescriptor, ActionInput, ActionLocation, ActionLocationDescriptor, ActionOutput, ActionScope, ActionsAccessor, ApiDescriptor, ApiExamples, ArrayEnvelope, AtomicCreateHandle, AtomicCreateInput, AtomicDeleteHandle, AtomicDescriptor, AtomicHandle, AtomicRecorder, AtomicRef, AtomicResult, AtomicResultOf, AtomicResults, AtomicUpdateHandle, AtomicUpdateInput, BinaryBody, BinaryResponseType, CANONICAL_PAGE_KEYS, Cardinality, Client, ClientIdPolicy, ClientOptions, Collection, CountToken, CountableDescriptor, CreateInput, DefaultActionTypes, DefaultAttributes, DefaultWriteAttributes, Document, DocumentEnvelope, Edge, EdgeEnvelope, EdgeMembers, ErrorCodeGuard, ErrorCodeOf, ExactPageParams, FieldSelectionMap, FieldsMap, FilterKey, FilterQuery, HANDLE_RESERVED, HeadersInit, HydratedMember, IdentifierMember, IncludePath, IncludedRelations, IncludedResource, IncludedType, InputMedia, InputMediaKind, JSON_API_MEDIA_TYPE, JsonApiContext, JsonApiError, JsonApiErrorObject, JsonApiRequest, JsonApiTransport, Link, LinkObject, LinkageRef, ListPageParams, LocalIdentifier, MaterialiseContext, MediaExamples, MediaTypeParams, MemberName, MenuDescriptor, NavigateOptions, OperationExamples, Page, PageKeys, PageLinks, PageMeta, PageOf, PageParams, PageParamsOf, PaginatorDescriptor, PaginatorKind, PaginatorRole, PaginatorStrategy, PivotDescriptor, PivotInput, RawMediaKind, RawOutputMedia, RawResponseType, ReadQuery, ReadResult, ReadableRelationName, RelatedIncludedResource, RelatedIncludedType, RelationDescriptor, RelationMutations, RelationName, RelationPageParams, RelationPaginator, RelationReadQuery, RelationView, RelationshipAccessor, RelationshipDocument, ResolvedPaginator, ResolvedValidator, ResourceAccessors, ResourceDescriptor, ResourceEnvelope, ResourceExamples, ResourceHandle, ResourceIdentifier, ResourceLinks, ResourceObjectView, SchemaMap, SingleReadQuery, SortQuery, SortToken, StrategyDescriptor, StructuralGuardError, ToDocumentOptions, TransportRawBody, TransportRequest, TransportResponse, TypeAccessor, TypeName, TypedPage, TypedReadQuery, UpdateInput, ValidationConfig, ValidationOption, Validator, WireResource, WithLinks, WriteDocument, WriteOptions, assertJsonApiDocument, createClient, execute, executeRaw, fetchTransport, hasErrorCode, isActionLocation, isPolymorphic, materialise, mediaType, readActionLocation, relatedPaginator, relatedPaginatorKind, remapPointer, remapRelationshipPointer, resolvePaginator, resolveValidator, runAtomic, serializeQuery, toDocument, toRelationshipDocument, validateDocument, withRemappedAtomicPaths, withRemappedPaths, withRemappedRelationshipPaths };
220
220
  //# sourceMappingURL=index.d.mts.map
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  //#region src/errors.ts
2
2
  /**
3
- * Thrown by the always-on light structural guards (ADR 0004) when a parsed response is not a
3
+ * Thrown by the always-on light structural guards when a parsed response is not a
4
4
  * JSON:API document, or a `data`/`included` member is not a resource object carrying `type`+`id`.
5
5
  * Distinct from {@link JsonApiError} (a non-2xx server response): this signals the wire shape the
6
6
  * runtime relies on was violated, not an application error the server reported. The opt-in
@@ -230,7 +230,7 @@ const defineGetter = (target, key, get) => {
230
230
  });
231
231
  };
232
232
  /**
233
- * Materialise a JSON:API document into a hydrated graph (ADR 0002 / CONTEXT.md):
233
+ * Materialise a JSON:API document into a hydrated graph (ADR 0002):
234
234
  *
235
235
  * - single resource -> a flattened resource object (own enumerable type/id/attributes/
236
236
  * relations + non-enumerable `$`-accessors);
@@ -356,7 +356,7 @@ function attachResourceEnvelope(node, raw, env, rels) {
356
356
  * edge-local `$edge`/`$pivot`. Identity is by `type:id`, never reference.
357
357
  *
358
358
  * `relationEdge` (set for a to-one) carries the relationship object's self/related links and
359
- * meta, which ride the value's `$edge` per CONTEXT.md.
359
+ * meta, which ride the value's `$edge` (docs/materialisation.md).
360
360
  */
361
361
  function buildEdgeView(node, member, relationEdge) {
362
362
  const view = {};
@@ -575,7 +575,7 @@ const isPlainObject$1 = (value) => typeof value === "object" && value !== null &
575
575
  * value — a `Range`/`DateRange` deepObject (`{ min, max }`) — and recurses into nested bracketed
576
576
  * keys (`filter[k][min]=`), matching the server's deepObject wire shape; an array joins with `,`;
577
577
  * a scalar is appended directly. Without the object branch a `{ min, max }` value would reach the
578
- * wire as `filter[k]=[object Object]` and be silently ignored by the server (D23).
578
+ * wire as `filter[k]=[object Object]` and be silently ignored by the server.
579
579
  */
580
580
  const appendFilterValue = (parts, key, value) => {
581
581
  if (isPlainObject$1(value)) {
@@ -792,7 +792,7 @@ const describe = (value) => value === null ? "null" : Array.isArray(value) ? "an
792
792
  * - `/data/relationships/orderedTracks/data/0/meta/pivot/position` -> `orderedTracks[0].$pivot.position`
793
793
  *
794
794
  * Pivot values nest under a member's `meta.pivot` (symmetric with reads — see
795
- * `JsonPointerBuilder::forLinkageMeta` / bundle ADR 0103), so a `meta/pivot/<field>` tail on
795
+ * `JsonPointerBuilder::forLinkageMeta`), so a `meta/pivot/<field>` tail on
796
796
  * a member of a pivot-bearing to-many is surfaced as `.$pivot.<field>`.
797
797
  *
798
798
  * A query-side pointer is left untouched (those are already user-facing — see