@haddowg/json-api-client 1.25.0 → 1.27.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.
@@ -25,8 +25,9 @@ interface RelationMutations {
25
25
  set?: boolean;
26
26
  }
27
27
  /**
28
- * The pivot fields one side of the wire carries on a member's `meta.pivot`, or the declared
29
- * identifier meta members a response carries on a member's `meta`: field name to wire-format
28
+ * The pivot fields one side of the wire carries on a member's `meta.pivot`, the declared
29
+ * identifier meta members a response carries on a member's `meta`, or the members a document
30
+ * declares in its top-level `meta`: field name to wire-format
30
31
  * hint (the vocabulary of {@link ResourceDescriptor.attributes}), the fields that are always
31
32
  * present, and the fields that may be `null`.
32
33
  */
@@ -39,6 +40,43 @@ interface PivotDescriptor {
39
40
  required?: readonly string[];
40
41
  /** The fields whose value may be `null`. Absent means none. */
41
42
  nullable?: readonly string[];
43
+ /**
44
+ * The members the object takes beside {@link fields}, when the server opens it: each one's
45
+ * wire-format hint (`unknown` for any value) and whether it may be `null`. `false` closes an
46
+ * identifier meta object. Absent closes every other object, and leaves an identifier meta object
47
+ * open, as a server that doesn't say leaves it.
48
+ */
49
+ additional?: AdditionalMembersDescriptor | false;
50
+ }
51
+ /** The undeclared members an open meta object takes: their wire-format hint, and whether `null`. */
52
+ interface AdditionalMembersDescriptor {
53
+ format: string;
54
+ nullable?: boolean;
55
+ }
56
+ /**
57
+ * The members a document declares in its top-level `meta`, read from the per-operation document
58
+ * component the server marks `x-document-meta`: each member's wire-format hint, the members every
59
+ * such document carries, and the members that may be `null`. A collection's also lists the `page`
60
+ * and `total` the server writes beside them, both optional. The document's `meta` is present
61
+ * whenever a member is required.
62
+ */
63
+ type DocumentMetaDescriptor = PivotDescriptor;
64
+ /** An operation of a type whose document may declare its top-level `meta`. */
65
+ type DocumentMetaOperation = 'fetchMany' | 'fetchOne' | 'create' | 'update' | 'delete';
66
+ /** A write of a type whose request document may declare its top-level `meta`. */
67
+ type RequestMetaOperation = 'create' | 'update' | 'delete';
68
+ /**
69
+ * The `meta` of a type's resource objects, read from the components the server marks
70
+ * `x-resource-meta`: `read` what a response renders, `create` and `update` what a write's
71
+ * `data.meta` takes. `atomicCreate` and `atomicUpdate` are the `data.meta` of an `add` or `update`
72
+ * inside an atomic batch, present only when they differ from `create` and `update`.
73
+ */
74
+ interface ResourceMetaDescriptor {
75
+ read?: PivotDescriptor;
76
+ create?: PivotDescriptor;
77
+ update?: PivotDescriptor;
78
+ atomicCreate?: PivotDescriptor;
79
+ atomicUpdate?: PivotDescriptor;
42
80
  }
43
81
  interface RelationDescriptor {
44
82
  cardinality: Cardinality;
@@ -163,6 +201,30 @@ interface RelationDescriptor {
163
201
  * type's {@link ResourceDescriptor.relatedQuery}. Only a monomorphic relation's can.
164
202
  */
165
203
  relatedQuery?: boolean;
204
+ /**
205
+ * The top-level `meta` the relation's related read declares: the related type's collection
206
+ * read's members for a to-many, its single read's for a to-one. Absent when it declares none.
207
+ */
208
+ documentMeta?: DocumentMetaDescriptor;
209
+ /**
210
+ * The top-level `meta` each relationship write takes, keyed by its verb, read from the request
211
+ * document the server marks `x-request-meta`. A verb that declares none has no entry, and the
212
+ * map is absent when none does.
213
+ */
214
+ requestMeta?: Readonly<Partial<Record<keyof RelationMutations, DocumentMetaDescriptor>>>;
215
+ /**
216
+ * The top-level `meta` each operation on the relation takes inside an atomic batch, keyed by its
217
+ * verb like {@link requestMeta}, read from the atomic relationship operation kinds the type has
218
+ * of its own for the relation. A verb that declares none has no entry, and the map is absent
219
+ * when none does.
220
+ */
221
+ atomicRequestMeta?: Readonly<Partial<Record<keyof RelationMutations, DocumentMetaDescriptor>>>;
222
+ /**
223
+ * The top-level `meta` of the meta-only `200` each relationship write answers with instead of
224
+ * the linkage, keyed by its verb. A verb answering with the linkage has no entry, and the map is
225
+ * absent when none answers meta-only.
226
+ */
227
+ mutationMeta?: Readonly<Partial<Record<keyof RelationMutations, DocumentMetaDescriptor>>>;
166
228
  }
167
229
  /** A built-in pagination strategy. */
168
230
  type PaginatorStrategy = 'page' | 'offset' | 'cursor' | 'fixed';
@@ -241,6 +303,8 @@ interface InputMedia {
241
303
  */
242
304
  interface AcceptedDescriptor {
243
305
  jobType: string;
306
+ /** The top-level `meta` the job document declares. Absent when it declares none. */
307
+ meta?: DocumentMetaDescriptor;
244
308
  }
245
309
  /**
246
310
  * A custom action declared on a type (`#[AsJsonApiAction]`). The runtime reaches it via
@@ -340,6 +404,24 @@ interface ActionDescriptor {
340
404
  * answers synchronously.
341
405
  */
342
406
  accepted?: AcceptedDescriptor;
407
+ /**
408
+ * The top-level `meta` each success status's document declares, keyed by status (`200`, `201`).
409
+ * Every status answering with a JSON:API document is listed, `null` for one that declares
410
+ * nothing. Absent when none declares any.
411
+ */
412
+ documentMeta?: Readonly<Record<string, DocumentMetaDescriptor | null>>;
413
+ /**
414
+ * `true` for a `document` output whose `200` answers with a meta-only document while another
415
+ * status answers with a resource, such as a `201` with the resource the action created. The
416
+ * result is then that `200`'s `meta` or the resource. Absent otherwise.
417
+ */
418
+ metaResult?: boolean;
419
+ /**
420
+ * The top-level `meta` the action's request document takes, read from the document the server
421
+ * marks `x-request-meta`. An action with input `none` sends a meta-only document carrying it.
422
+ * Absent when the action declares none.
423
+ */
424
+ requestMeta?: DocumentMetaDescriptor;
343
425
  }
344
426
  /**
345
427
  * The `withCount` capability of a type's read endpoints (the Countable profile, core ADR
@@ -440,6 +522,23 @@ interface ResourceDescriptor {
440
522
  * is includable, or the document types `included` only as `{type, id}`.
441
523
  */
442
524
  included?: readonly string[];
525
+ /**
526
+ * The attributes whose single keys a sparse fieldset may select, under the Nested Fieldsets
527
+ * profile: attribute name -> the pattern a key must match (a regular expression source,
528
+ * unanchored and without delimiters), `\*` for a list whose items take keys. Each adds
529
+ * `<attribute>.${string}` to the members `fields` takes for this type. Absent when no attribute
530
+ * declares a nested fieldset.
531
+ */
532
+ nestedFieldsets?: Readonly<Record<string, string>>;
533
+ /**
534
+ * The paths into nested objects a sparse fieldset may select of the attributes in
535
+ * {@link nestedFieldsets}: attribute name -> one entry per path, each the pattern of every key
536
+ * along it after the attribute's own, such as `['geo', '(?:lat|lng)']` for `location.geo.lat`,
537
+ * or `['\\*', '(?:sku|qty)']` for `lines.*.sku`, where `\*` stands for every item of a list.
538
+ * A key that is a plain name is escaped the way the server escapes it. Absent when no nested fieldset
539
+ * key holds an object or a list whose own keys may be selected.
540
+ */
541
+ nestedFieldsetPaths?: Readonly<Record<string, readonly (readonly string[])[]>>;
443
542
  /**
444
543
  * The sort tokens the COLLECTION read accepts in `sort` — signed field names (`title`,
445
544
  * `-title`). Drives `sort` narrowing. Absent when the collection advertises no sorting (so
@@ -489,6 +588,28 @@ interface ResourceDescriptor {
489
588
  * {@link ActionDescriptor.accepted}.
490
589
  */
491
590
  accepted?: Readonly<Partial<Record<AcceptedOperation, AcceptedDescriptor>>>;
591
+ /**
592
+ * The top-level `meta` each of the type's operations declares, keyed `fetchMany`, `fetchOne`,
593
+ * `create`, `update` or `delete`. A delete's applies to its meta-only `200`. An operation that
594
+ * declares none has no entry, and the map is absent when none does. A relation's related read
595
+ * has its own on {@link RelationDescriptor.documentMeta}, an action's on
596
+ * {@link ActionDescriptor.documentMeta}.
597
+ */
598
+ documentMeta?: Readonly<Partial<Record<DocumentMetaOperation, DocumentMetaDescriptor>>>;
599
+ /**
600
+ * The top-level `meta` each of the type's writes takes, keyed `create`, `update` or `delete`,
601
+ * read from the request document the server marks `x-request-meta`. A delete declaring it takes
602
+ * a meta-only request document. A write that declares none has no entry, and the map is absent
603
+ * when none does.
604
+ */
605
+ requestMeta?: Readonly<Partial<Record<RequestMetaOperation, DocumentMetaDescriptor>>>;
606
+ /**
607
+ * The top-level `meta` each of the type's operations takes inside an atomic batch, keyed like
608
+ * {@link requestMeta}, read from the atomic operation kinds the type has of its own.
609
+ */
610
+ atomicRequestMeta?: Readonly<Partial<Record<RequestMetaOperation, DocumentMetaDescriptor>>>;
611
+ /** The `meta` of the type's resource objects, as a read renders it and a write sends it. */
612
+ resourceMeta?: ResourceMetaDescriptor;
492
613
  }
493
614
  /** A write that can answer `202 Accepted`. */
494
615
  type AcceptedOperation = 'create' | 'update';
@@ -548,15 +669,18 @@ interface PollOptions {
548
669
  signal?: AbortSignal;
549
670
  }
550
671
  /**
551
- * A write the server accepted for later (`202 Accepted`). `Job` is the job it answered with and
552
- * `Result` what the write resolves to once the job is done.
672
+ * A write the server accepted for later (`202 Accepted`). `Job` is the job it answered with,
673
+ * `Result` what the write resolves to once the job is done, and `Meta` the job document's
674
+ * top-level `meta`.
553
675
  */
554
- interface Accepted<Job, Result = unknown> {
676
+ interface Accepted<Job, Result = unknown, Meta = Record<string, unknown> | undefined> {
555
677
  /**
556
678
  * The job, materialised as its type's resource, or the document's top-level `meta` when the
557
679
  * server answered with a meta-only document.
558
680
  */
559
681
  readonly job: Job;
682
+ /** The `202` document's top-level `meta`, typed with the members the operation declares. */
683
+ readonly meta: Meta;
560
684
  /** The job URL, from `Content-Location`, which {@link $poll} reads until the job is done. */
561
685
  readonly contentLocation: string;
562
686
  /**
@@ -743,6 +867,25 @@ type PageParamsOf<P extends Page> = PaginatorKind extends P['kind'] ? Readonly<R
743
867
  kind: A;
744
868
  } : unknown);
745
869
  //#endregion
870
+ //#region src/nested-fieldset.d.ts
871
+ /**
872
+ * The keys a sparse fieldset selected of each attribute it narrowed, under the Nested Fieldsets
873
+ * profile (https://haddowg.github.io/json-api/profiles/nested-fieldsets/): attribute name -> the
874
+ * paths `fields[type]=<attribute>.<path>` named, in request order, each once. A path into a nested
875
+ * object, such as `geo.lat`, names one key per level, and a path through a list names its items
876
+ * `*`, such as `*.sku`. An attribute the fieldset also lists whole
877
+ * is left out, and so is a path whose key the fieldset also lists whole, since the server renders
878
+ * those whole. A path ending in `*` names the list itself, so `lines.*` lists `lines` whole and
879
+ * `shipping.parcels.*` selects `parcels` whole. Empty when nothing was narrowed.
880
+ */
881
+ type NestedFieldset = Readonly<Record<string, readonly string[]>>;
882
+ /**
883
+ * The {@link NestedFieldset} of one type's `fields[type]` members. The path is everything after the
884
+ * first full stop, as the server reads it, and a member with an empty key at any level selects
885
+ * nothing.
886
+ */
887
+ declare function nestedFieldset(listed: readonly string[] | undefined): NestedFieldset;
888
+ //#endregion
746
889
  //#region src/materialise.d.ts
747
890
  /** A trimmed, by-reference top-level envelope shared by every resource from one response. */
748
891
  interface DocumentEnvelope {
@@ -792,6 +935,11 @@ interface ResourceEnvelope {
792
935
  readonly $self: string | undefined;
793
936
  readonly $document: DocumentEnvelope;
794
937
  readonly $raw: RawResource;
938
+ /**
939
+ * The keys the request's sparse fieldset selected of each attribute it narrowed, under the Nested
940
+ * Fieldsets profile. An attribute named here holds only those of its keys the resource has.
941
+ */
942
+ readonly $nestedFieldset: NestedFieldset;
795
943
  $rel(name: string): RelationView | undefined;
796
944
  /**
797
945
  * A relationship's count, from its `meta.total` (a `withCount` read): a finite number, else
@@ -840,6 +988,11 @@ interface MaterialiseContext {
840
988
  * before the document is materialised. Absent => no per-field validation (the default).
841
989
  */
842
990
  validate?: ResolvedValidator | undefined;
991
+ /**
992
+ * The sparse fieldsets the request sent, by type, which tell an attribute narrowed to some of
993
+ * its keys from one rendered whole (see {@link ResourceEnvelope.$nestedFieldset}).
994
+ */
995
+ fields?: Readonly<Record<string, readonly string[]>> | undefined;
843
996
  }
844
997
  /** A raw JSON:API resource object (or bare identifier) off the wire. */
845
998
  interface RawResource {
@@ -957,7 +1110,7 @@ type AtomicRef = ResourceIdentifier | {
957
1110
  */
958
1111
  type AtomicCreateInput<D extends ApiDescriptor, W, T extends TypeName<D>> = {
959
1112
  type: T;
960
- } & CreateInput<D, W, T>;
1113
+ } & CreateInput<D, W, T, 'atomicCreate'>;
961
1114
  /**
962
1115
  * Flat update input for type `T`: the `type` discriminant + the target's identity (`id`, OR a
963
1116
  * `lid` for a resource created earlier in the same batch) plus the type's flat update
@@ -967,11 +1120,22 @@ type AtomicUpdateInput<D extends ApiDescriptor, W, T extends TypeName<D>> = ({
967
1120
  type: T;
968
1121
  id: string;
969
1122
  lid?: never;
970
- } & UpdateInput<D, W, T>) | ({
1123
+ } & UpdateInput<D, W, T, 'atomicUpdate'>) | ({
971
1124
  type: T;
972
1125
  lid: string;
973
1126
  id?: never;
974
- } & UpdateInput<D, W, T>);
1127
+ } & UpdateInput<D, W, T, 'atomicUpdate'>);
1128
+ /**
1129
+ * The options argument of an atomic operation of type `T`: the operation's `meta`, typed by the
1130
+ * type's `atomicRequestMeta` and required when a member is. A type declaring none takes any.
1131
+ */
1132
+ type AtomicOperationArgs<D extends ApiDescriptor, T extends TypeName<D>, Op extends RequestMetaOperation> = OptionsArg<RequiresRequestMeta<RequestMetaOf<D, T, Op, true>>, MetaOption<RequestMetaOf<D, T, Op, true>>>;
1133
+ /**
1134
+ * The options argument of an atomic operation with verb `V` on relation `R` of type `T`: its
1135
+ * `meta`, typed by the relation's `atomicRequestMeta` and required when a member is. A relation
1136
+ * declaring none takes any.
1137
+ */
1138
+ type AtomicRelationshipArgs<D extends ApiDescriptor, T extends TypeName<D>, R extends RelationName<D, T>, V extends MutationVerb> = OptionsArg<RequiresRequestMeta<RelationRequestMetaOf<D, T, R, V, true>>, MetaOption<RelationRequestMetaOf<D, T, R, V, true>>>;
975
1139
  /**
976
1140
  * The handle a {@link AtomicRecorder.create} returns. It is a `lid`-bearing relationship ref
977
1141
  * (`{ type, lid }`) — pass it (or spread it) into a later op's relation slot to wire the
@@ -1002,6 +1166,18 @@ interface AtomicDeleteHandle {
1002
1166
  readonly kind: 'delete';
1003
1167
  readonly opIndex: number;
1004
1168
  }
1169
+ /**
1170
+ * The handle a relationship operation returns (the `add`, `remove`, `replace` or `set` of
1171
+ * {@link AtomicRecorder.rel}): the target's type `T`, its `relationship` `R`, its op `kind`
1172
+ * (`'relationship'`) and its `opIndex`. Its positional result is the linkage the server answered
1173
+ * with.
1174
+ */
1175
+ interface AtomicRelationshipHandle<T extends string = string, R extends string = string> {
1176
+ readonly type: T;
1177
+ readonly relationship: R;
1178
+ readonly kind: 'relationship';
1179
+ readonly opIndex: number;
1180
+ }
1005
1181
  /**
1006
1182
  * Any handle a recorder method returns — the element type of the callback's result tuple, used
1007
1183
  * as the inference constraint for the typed-tuple `atomic` form. The discriminant is left open
@@ -1012,7 +1188,28 @@ interface AtomicDeleteHandle {
1012
1188
  * is a real `TypeName<D>`, so the open constraint is sound; `AtomicResultOf` re-infers the precise
1013
1189
  * `T` per element (guarded by `TypeName<D>` there).
1014
1190
  */
1015
- type AtomicHandle = AtomicCreateHandle<string> | AtomicUpdateHandle<string> | AtomicDeleteHandle;
1191
+ type AtomicHandle = AtomicCreateHandle<string> | AtomicUpdateHandle<string> | AtomicDeleteHandle | AtomicRelationshipHandle<string, string>;
1192
+ /**
1193
+ * A relationship verb inside an atomic batch: present only when relation `R`'s cardinality matches
1194
+ * the verb's and the relation advertises it in its `mutations` flags, as the standalone accessor's
1195
+ * verbs are gated, and `never` otherwise.
1196
+ */
1197
+ type AtomicRelationMutation<D extends ApiDescriptor, T extends TypeName<D>, R extends RelationName<D, T>, V extends MutationVerb> = TakesVerb<D, T, R, V> extends true ? (members: RelationshipMembers<D, T, R, V>, ...opts: AtomicRelationshipArgs<D, T, R, V>) => AtomicRelationshipHandle<T, R> : never;
1198
+ /**
1199
+ * What {@link AtomicRecorder.rel} returns: relation `R` of a resource of type `T`, whose verbs
1200
+ * each record one relationship operation. A to-many takes `add`, `remove` and `replace` and a
1201
+ * to-one `set`, each only when the relation advertises it.
1202
+ */
1203
+ interface AtomicRelationshipRecorder<D extends ApiDescriptor, T extends TypeName<D>, R extends RelationName<D, T>> {
1204
+ /** Add `members` to the to-many: an `add` op on its relationship. */
1205
+ add: AtomicRelationMutation<D, T, R, 'add'>;
1206
+ /** Remove `members` from the to-many: a `remove` op on its relationship. */
1207
+ remove: AtomicRelationMutation<D, T, R, 'remove'>;
1208
+ /** Replace every member of the to-many with `members`: an `update` op on its relationship. */
1209
+ replace: AtomicRelationMutation<D, T, R, 'replace'>;
1210
+ /** Set the to-one to `member`, or clear it with `null`: an `update` op on its relationship. */
1211
+ set: AtomicRelationMutation<D, T, R, 'set'>;
1212
+ }
1016
1213
  /**
1017
1214
  * The recorder handed to the `client.atomic` callback. Each method appends an op (preserving
1018
1215
  * order) and returns a handle carrying the op's discriminant `T`, `kind`, and `opIndex`. The
@@ -1022,9 +1219,19 @@ type AtomicHandle = AtomicCreateHandle<string> | AtomicUpdateHandle<string> | At
1022
1219
  * just-created resource wires into a later op without a server id.
1023
1220
  */
1024
1221
  interface AtomicRecorder<D extends ApiDescriptor, W> {
1025
- create<T extends TypeName<D>>(input: AtomicCreateInput<D, W, T>): AtomicCreateHandle<T>;
1026
- update<T extends TypeName<D>>(input: AtomicUpdateInput<D, W, T>): AtomicUpdateHandle<T>;
1027
- delete(ref: AtomicRef): AtomicDeleteHandle;
1222
+ create<T extends TypeName<D>>(input: AtomicCreateInput<D, W, T>, ...opts: AtomicOperationArgs<D, T, 'create'>): AtomicCreateHandle<T>;
1223
+ update<T extends TypeName<D>>(input: AtomicUpdateInput<D, W, T>, ...opts: AtomicOperationArgs<D, T, 'update'>): AtomicUpdateHandle<T>;
1224
+ delete<T extends TypeName<D>>(ref: AtomicRef & {
1225
+ type: T;
1226
+ }, ...opts: AtomicOperationArgs<D, T, 'delete'>): AtomicDeleteHandle;
1227
+ /**
1228
+ * Relation `relationship` of the resource `ref` names, by its server `id` or the `lid` of a
1229
+ * resource created earlier in the batch. Its verbs record operations on the relationship. Only
1230
+ * a relation that takes at least one verb is accepted.
1231
+ */
1232
+ rel<T extends TypeName<D>, R extends WritableRelationName<D, T>>(ref: AtomicRef & {
1233
+ type: T;
1234
+ }, relationship: R): AtomicRelationshipRecorder<D, T, R>;
1028
1235
  }
1029
1236
  /** One positional result of an atomic batch: the materialised `data` (a resource/`null`) plus any op `meta`. */
1030
1237
  interface AtomicResult<Data = unknown> {
@@ -1093,12 +1300,14 @@ declare function readActionLocation(doc: Document, declared: ActionLocationDescr
1093
1300
  * (`$page`/`$links`/`$meta`) plus link-driven `$next()`/`$prev()` navigation. The same
1094
1301
  * model backs top-level collections, related-endpoint collections, and hydrated/linkage
1095
1302
  * to-many relationship values ("one model, three surfaces"). `P` types `$page` by the strategy
1096
- * that answered (see {@link PageOf}); following a link keeps it.
1303
+ * that answered (see {@link PageOf}); following a link keeps it. `M` types `$meta`, the top-level
1304
+ * `meta` of a collection or related read whose document declares it (see {@link DocumentMeta}).
1097
1305
  */
1098
- type Collection<T, P = Page> = ReadonlyArray<T> & Omit<ArrayEnvelope, '$page' | '$next' | '$prev'> & {
1306
+ type Collection<T, P = Page, M = Record<string, unknown> | undefined> = ReadonlyArray<T> & Omit<ArrayEnvelope, '$page' | '$next' | '$prev' | '$meta'> & {
1099
1307
  readonly $page: P;
1100
- $next(options?: NavigateOptions): Promise<Collection<T, P> | undefined>;
1101
- $prev(options?: NavigateOptions): Promise<Collection<T, P> | undefined>;
1308
+ readonly $meta: M;
1309
+ $next(options?: NavigateOptions): Promise<Collection<T, P, M> | undefined>;
1310
+ $prev(options?: NavigateOptions): Promise<Collection<T, P, M> | undefined>;
1102
1311
  };
1103
1312
  /**
1104
1313
  * A to-many relationship value: a {@link Collection} that also carries `$count`, the
@@ -1119,15 +1328,21 @@ interface EdgeMembers<Pivot = Record<string, unknown>, Meta extends Record<strin
1119
1328
  /**
1120
1329
  * The resource-level `$`-accessors on a materialised resource object. `Links` types `$links`: the
1121
1330
  * type's generated links interface when its resources declare links, else the loose
1122
- * {@link ResourceLinks}.
1331
+ * {@link ResourceLinks}. `Meta` types `$meta`, the resource object's own `meta`: the members its
1332
+ * type declares, else the loose record.
1123
1333
  */
1124
- interface ResourceAccessors<Links = ResourceLinks> {
1125
- readonly $meta: Record<string, unknown> | undefined;
1334
+ interface ResourceAccessors<Links = ResourceLinks, Meta = Record<string, unknown> | undefined> {
1335
+ readonly $meta: Meta;
1126
1336
  readonly $links: Links | undefined;
1127
1337
  /** The `self` link's href, whether the wire carried a bare URL or a link object. */
1128
1338
  readonly $self: string | undefined;
1129
1339
  readonly $document: DocumentEnvelope;
1130
1340
  readonly $raw: Record<string, unknown>;
1341
+ /**
1342
+ * The keys the request's sparse fieldset selected of each attribute it narrowed, under the Nested
1343
+ * Fieldsets profile. Empty when the request narrowed no attribute of this type.
1344
+ */
1345
+ readonly $nestedFieldset: NestedFieldset;
1131
1346
  $rel(name: string): RelationView | undefined;
1132
1347
  }
1133
1348
  /** Every wire type declared by the descriptor `D`. */
@@ -1181,6 +1396,44 @@ type SelectedFields<F, T extends string> = F extends FieldSelectionMap ? T exten
1181
1396
  * object's keys are exactly the requested members — the static mirror of a sparse fieldset.
1182
1397
  */
1183
1398
  type PickSelected<Obj, Sel> = [Sel] extends [AllFields] ? Obj : Pick<Obj, Extract<keyof Obj, Sel>>;
1399
+ /** The attribute a nested fieldset member names: `values` for `values.cap`. */
1400
+ type NestedFieldsetAttribute<Sel> = Sel extends `${infer Attribute}.${string}` ? Attribute : never;
1401
+ /** The paths of attribute `Attr` the nested fieldset members in `Sel` select: everything after the first dot. */
1402
+ type SelectedKeysOf<Sel, Attr extends string> = Sel extends `${Attr}.${infer Key}` ? Key : never;
1403
+ /** The first key of each path in `K`: `geo` for `geo.lat`, `*` for `*.sku`. */
1404
+ type PathHead<K extends string> = K extends `${infer Head}.${string}` ? Head : K;
1405
+ /** What the paths in `K` select inside key `Head`: `lat` for `geo.lat`. */
1406
+ type PathTail<K extends string, Head extends string> = K extends `${Head}.${infer Tail}` ? Tail : never;
1407
+ /** Whether `T` is a union of more than one member. */
1408
+ type IsUnion<T, U = T> = T extends unknown ? ([U] extends [T] ? false : true) : never;
1409
+ /** The keys of `V` whose value is one string literal, such as a union variant's discriminator. */
1410
+ type LiteralStringKey<V> = { [P in keyof V]-?: V[P] extends string ? (string extends V[P] ? never : P) : never }[keyof V];
1411
+ /**
1412
+ * The key every member of the union `U` holds as one string literal, which names its variant, or
1413
+ * `never` when `U` is not a union.
1414
+ */
1415
+ type DiscriminatorKey<U> = true extends IsUnion<U> ? Exclude<keyof U, U extends unknown ? Exclude<keyof U, LiteralStringKey<U>> : never> : never;
1416
+ /** One object type for an intersection, each key keeping whether it is optional. */
1417
+ type Flatten<T> = { [P in keyof T]: T[P] };
1418
+ /**
1419
+ * An attribute value narrowed to the paths `K`, each key optional, since a value without a selected
1420
+ * key leaves it out. A path into a nested object (`geo.lat`) narrows that object the same way,
1421
+ * unless `K` also lists its key whole. A list narrowed through `*` (`*.sku`) keeps every item, each
1422
+ * narrowed to the rest of the path, unless `K` also lists `*` whole. A value that is one of several
1423
+ * variants, as an attribute, a nested key or a list's item, narrows each variant on its own and
1424
+ * keeps the key naming it. `null` stays as it is, and a key type the client can't list keeps every
1425
+ * key.
1426
+ */
1427
+ type KeySelected<V, K extends string> = KeySelectedAs<V, K, DiscriminatorKey<Exclude<V, null | undefined | readonly unknown[]>>>;
1428
+ /** {@link KeySelected}, given the key `D` naming the variant of a union value. */
1429
+ type KeySelectedAs<V, K extends string, D> = V extends readonly (infer Item)[] ? string extends K ? Partial<Item>[] : '*' extends K ? V : KeySelected<Item, PathTail<K, '*'>>[] : V extends object ? string extends K ? Partial<V> : [D] extends [never] ? NarrowedObject<V, K> : Flatten<NarrowedObject<V, K> & Pick<V, Extract<D, keyof V>>> : V;
1430
+ /** The keys of the object `V` the paths `K` select, each optional and narrowed in turn. */
1431
+ type NarrowedObject<V, K extends string> = { [P in Extract<PathHead<K>, keyof V>]?: P extends K ? V[P] : KeySelected<V[P], PathTail<K, P>> };
1432
+ /**
1433
+ * {@link PickSelected} for attributes: an attribute the selection names only through nested fieldset members
1434
+ * (`values.cap`) is present and narrowed to those keys, while one it lists whole stays whole.
1435
+ */
1436
+ type PickSelectedAttributes<Obj, Sel> = [Sel] extends [AllFields] ? Obj : Pick<Obj, Extract<keyof Obj, Sel>> & { [K in keyof Obj as K extends Exclude<NestedFieldsetAttribute<Sel>, Sel> ? K : never]: KeySelected<Obj[K], SelectedKeysOf<Sel, K & string>> };
1184
1437
  /**
1185
1438
  * The related wire type(s) of relation `R` on type `T`. A union when polymorphic; the
1186
1439
  * member is narrowed to types that actually exist in the descriptor so the hydrated
@@ -1264,7 +1517,7 @@ interface CountAccessor<D extends ApiDescriptor, T extends TypeName<D>, Counted
1264
1517
  type ResourceObjectView<D extends ApiDescriptor, A, T extends TypeName<D>, Inc = never, F = unknown, Counted = never> = {
1265
1518
  type: T;
1266
1519
  id: string;
1267
- } & PickSelected<AttributesOf<A, T>, SelectedFields<F, T>> & Relations<D, A, T, Inc, F> & ResourceAccessors<LinksOf<A, T>> & CountAccessor<D, T, Counted>;
1520
+ } & PickSelectedAttributes<AttributesOf<A, T>, SelectedFields<F, T>> & Relations<D, A, T, Inc, F> & ResourceAccessors<LinksOf<A, T>, ResourceMetaOf<D, T>> & CountAccessor<D, T, Counted>;
1268
1521
  /**
1269
1522
  * The element type of the `include` array for type `T`: a path from the descriptor's
1270
1523
  * `includable` enum — the exact set the server advertises, including nested dotted paths
@@ -1463,7 +1716,15 @@ type FieldsMap<D extends ApiDescriptor> = { [T in TypeName<D>]?: readonly Member
1463
1716
  * `attributes` keys) or a relation a response renders. The descriptor carries the literal member
1464
1717
  * names, so `fields` entries are constrained to real members.
1465
1718
  */
1466
- type MemberName<D extends ApiDescriptor, T extends TypeName<D>> = Extract<keyof D[T]['attributes'], string> | ReadableRelationName<D, T>;
1719
+ type MemberName<D extends ApiDescriptor, T extends TypeName<D>> = Extract<keyof D[T]['attributes'], string> | ReadableRelationName<D, T> | NestedFieldsetMember<D, T>;
1720
+ /**
1721
+ * A nested fieldset member of type `T`: `<attribute>.${string}` for each attribute whose single keys a sparse
1722
+ * fieldset may select (the descriptor's `nestedFieldsets`), under the Nested Fieldsets profile.
1723
+ * `never` when the type declares none.
1724
+ */
1725
+ type NestedFieldsetMember<D extends ApiDescriptor, T extends TypeName<D>> = D[T] extends {
1726
+ nestedFieldsets: infer S;
1727
+ } ? `${Extract<keyof S, string>}.${string}` : never;
1467
1728
  /**
1468
1729
  * The `relatedQuery` entry for relation `R` of type `T`: its `filter` and `sort` typed as the
1469
1730
  * relation's own related read types them (see {@link RelationFilterQuery} and
@@ -1637,6 +1898,30 @@ type PivotFieldNames<P> = P extends {
1637
1898
  } ? keyof Fl : never;
1638
1899
  /** The `meta.pivot` object a {@link PivotDescriptor} describes. */
1639
1900
  type PivotObject<P> = { readonly [K in PivotFieldNames<P> as K extends RequiredPivotField<P> ? K : never]: PivotValue<P, K> } & { readonly [K in PivotFieldNames<P> as K extends RequiredPivotField<P> ? never : K]?: PivotValue<P, K> };
1901
+ /** The value an open {@link PivotDescriptor} takes for each member beside its fields. */
1902
+ type AdditionalValue<P> = P extends {
1903
+ additional: infer X;
1904
+ } ? X extends {
1905
+ format: infer H;
1906
+ } ? FormatToTs<H> | (X extends {
1907
+ nullable: true;
1908
+ } ? null : never) : never : never;
1909
+ /** The value of any declared field of a {@link PivotDescriptor}. */
1910
+ type DeclaredValue<P> = P extends {
1911
+ fields: infer Fl;
1912
+ } ? { [K in keyof Fl]: PivotValue<P, K> }[keyof Fl] : never;
1913
+ /**
1914
+ * The undeclared members an open {@link PivotDescriptor} takes, as an index signature whose value
1915
+ * also admits each declared field's and `Extra`, the other members the object carries, so the
1916
+ * declared ones keep their types. `unknown`, adding nothing, for a closed object.
1917
+ */
1918
+ type AdditionalMembers<P, Extra = never> = P extends {
1919
+ additional: {
1920
+ format: unknown;
1921
+ };
1922
+ } ? {
1923
+ readonly [member: string]: AdditionalValue<P> | DeclaredValue<P> | Extra | undefined;
1924
+ } : unknown;
1640
1925
  /** The legacy hint-only pivot shape: every field present and non-null. */
1641
1926
  type LegacyPivot<P> = { readonly [K in keyof P]: FormatToTs<P[K]> };
1642
1927
  /**
@@ -1647,17 +1932,29 @@ type LegacyPivot<P> = { readonly [K in keyof P]: FormatToTs<P[K]> };
1647
1932
  */
1648
1933
  type PivotFieldsOf<D extends ApiDescriptor, T extends TypeName<D>, R extends RelationName<D, T>> = D[T]['relations'][R] extends {
1649
1934
  readPivot: infer P;
1650
- } ? PivotObject<P> : D[T]['relations'][R] extends {
1935
+ } ? PivotObject<P> & AdditionalMembers<P> : D[T]['relations'][R] extends {
1651
1936
  pivotFields: infer P;
1652
1937
  } ? LegacyPivot<P> : Record<string, unknown>;
1653
1938
  /**
1654
1939
  * The `$edge.meta` of each linkage member of relation `R`: the members the descriptor's
1655
- * `identifierMeta` declares, typed like a pivot, over an open record that still carries
1656
- * `pivot` and any other meta. A relation declaring none keeps the open record.
1940
+ * `identifierMeta` declares, typed like a pivot, with the relation's `pivot` beside them. An
1941
+ * identifier meta that says whether it is open takes only those, and the undeclared members it
1942
+ * opens to; one that doesn't say is an open record. A relation declaring none keeps the open
1943
+ * record.
1657
1944
  */
1658
1945
  type EdgeMetaOf<D extends ApiDescriptor, T extends TypeName<D>, R extends RelationName<D, T>> = D[T]['relations'][R] extends {
1659
1946
  identifierMeta: infer P;
1660
- } ? PivotObject<P> & Record<string, unknown> : Record<string, unknown>;
1947
+ } ? P extends {
1948
+ additional: false | {
1949
+ format: unknown;
1950
+ };
1951
+ } ? PivotObject<P> & EdgePivot<D, T, R> & AdditionalMembers<P, PivotFieldsOf<D, T, R>> : PivotObject<P> & Record<string, unknown> : Record<string, unknown>;
1952
+ /** The `pivot` a pivot relation's identifier meta carries beside its declared members. */
1953
+ type EdgePivot<D extends ApiDescriptor, T extends TypeName<D>, R extends RelationName<D, T>> = D[T]['relations'][R] extends {
1954
+ pivot: true;
1955
+ } ? {
1956
+ readonly pivot?: PivotFieldsOf<D, T, R>;
1957
+ } : unknown;
1661
1958
  /**
1662
1959
  * The typed `meta.pivot` a request may send on each member of relation `R`, from the descriptor's
1663
1960
  * `writePivot` (only writable fields, optional unless required). Falls back like
@@ -1665,16 +1962,152 @@ type EdgeMetaOf<D extends ApiDescriptor, T extends TypeName<D>, R extends Relati
1665
1962
  */
1666
1963
  type WritePivotOf<D extends ApiDescriptor, T extends TypeName<D>, R extends RelationName<D, T>> = D[T]['relations'][R] extends {
1667
1964
  writePivot: infer P;
1668
- } ? PivotObject<P> : D[T]['relations'][R] extends {
1965
+ } ? PivotObject<P> & AdditionalMembers<P> : D[T]['relations'][R] extends {
1669
1966
  pivotFields: infer P;
1670
1967
  } ? LegacyPivot<P> : PivotInput;
1968
+ /** Whether a {@link DocumentMetaDescriptor} requires a member, so its document always carries `meta`. */
1969
+ type RequiresMeta<P> = [RequiredPivotField<P>] extends [never] ? false : true;
1970
+ /**
1971
+ * The object of members a document meta descriptor declares, mapped over its `fields` so each
1972
+ * member keeps the JSDoc the codegen writes on its entry.
1973
+ */
1974
+ type DeclaredMetaObject<P> = P extends {
1975
+ fields: infer Fl;
1976
+ } ? { readonly [K in keyof Fl as K extends RequiredPivotField<P> ? K : never]: PivotValue<P, K> } & { readonly [K in keyof Fl as K extends RequiredPivotField<P> ? never : K]?: PivotValue<P, K> } : never;
1977
+ /**
1978
+ * A declared `meta` object: the members a {@link PivotDescriptor} declares, each required one
1979
+ * present, and the undeclared members it takes when the server opens it. A closed object takes no
1980
+ * other member.
1981
+ */
1982
+ type MetaObject<P> = P extends {
1983
+ fields: infer Fl;
1984
+ } ? [keyof Fl] extends [never] ? P extends {
1985
+ additional: {
1986
+ format: unknown;
1987
+ };
1988
+ } ? AdditionalMembers<P> : {
1989
+ readonly [member: string]: never;
1990
+ } : DeclaredMetaObject<P> & AdditionalMembers<P> : never;
1991
+ /**
1992
+ * The top-level `meta` a {@link DocumentMetaDescriptor} types: its members, or `undefined` when
1993
+ * none is required, since the document may then carry no `meta`. A collection's also has the
1994
+ * `page` and `total` the server writes. `null`, a status that declares nothing, reads as the
1995
+ * loose record.
1996
+ */
1997
+ type DocumentMeta<P> = P extends {
1998
+ fields: object;
1999
+ } ? RequiresMeta<P> extends true ? MetaObject<P> : MetaObject<P> | undefined : Record<string, unknown> | undefined;
2000
+ /**
2001
+ * The `meta` of type `T`'s resource objects, as `$meta` reads it: the members its `resourceMeta`
2002
+ * declares for a read, else the loose record. A resource object may carry no `meta`.
2003
+ */
2004
+ type ResourceMetaOf<D extends ApiDescriptor, T extends TypeName<D>> = D[T] extends {
2005
+ resourceMeta: {
2006
+ read: infer P;
2007
+ };
2008
+ } ? MetaObject<P> | undefined : Record<string, unknown> | undefined;
2009
+ /** A write's `data.meta`, by where it is sent: a create or an update, alone or in an atomic batch. */
2010
+ type ResourceWriteOperation = 'create' | 'update' | 'atomicCreate' | 'atomicUpdate';
2011
+ /** The write a {@link ResourceWriteOperation} inside an atomic batch takes its `data.meta` from otherwise. */
2012
+ type StandaloneWrite<Op extends ResourceWriteOperation> = Op extends 'atomicCreate' ? 'create' : Op extends 'atomicUpdate' ? 'update' : Op;
2013
+ /**
2014
+ * The `$meta` a write input of type `T` takes, sent as `data.meta`: the members its
2015
+ * `resourceMeta` declares for `Op`, an atomic one falling back to its standalone write's, else the
2016
+ * loose record a type declaring none takes.
2017
+ */
2018
+ type ResourceWriteMeta<D extends ApiDescriptor, T extends TypeName<D>, Op extends ResourceWriteOperation> = D[T] extends {
2019
+ resourceMeta: infer M;
2020
+ } ? Op extends keyof M ? MetaObject<M[Op]> : StandaloneWrite<Op> extends keyof M ? MetaObject<M[StandaloneWrite<Op>]> : Record<string, unknown> : Record<string, unknown>;
2021
+ /**
2022
+ * The top-level `meta` write `Op` of type `T` takes: the members its `requestMeta` declares, or,
2023
+ * with `Atomic`, its `atomicRequestMeta`'s. `never` when it declares none.
2024
+ */
2025
+ type RequestMetaOf<D extends ApiDescriptor, T extends TypeName<D>, Op extends RequestMetaOperation, Atomic extends boolean = false> = D[T] extends { [K in Atomic extends true ? 'atomicRequestMeta' : 'requestMeta']: infer M } ? Op extends keyof M ? M[Op] extends {
2026
+ fields: object;
2027
+ } ? MetaObject<M[Op]> : never : never : never;
2028
+ /**
2029
+ * The `meta` option of a write whose request document declares `M`: required when `M` has a
2030
+ * required member, else optional. A write declaring none takes the open record, as its document
2031
+ * may carry any `meta`.
2032
+ */
2033
+ type MetaOption<M> = [M] extends [never] ? {
2034
+ meta?: Record<string, unknown>;
2035
+ } : RequiresRequestMeta<M> extends true ? {
2036
+ meta: M;
2037
+ } : {
2038
+ meta?: M;
2039
+ };
2040
+ /** Whether a declared request `meta` has a required member, so a call must send it. */
2041
+ type RequiresRequestMeta<M> = [M] extends [never] ? false : [RequiredKeysOf<M>] extends [never] ? false : true;
2042
+ /** The keys of an object type whose members are required. */
2043
+ type RequiredKeysOf<M> = { [K in keyof M]-?: string extends K ? never : {} extends Pick<M, K> ? never : K }[keyof M];
2044
+ /** The options argument of a call taking options `O`: required when `Req` is `true`, else optional. */
2045
+ type OptionsArg<Req, O> = Req extends true ? [opts: O] : [opts?: O];
2046
+ /** The `meta` option of write `Op` on type `T`, as {@link MetaOption} types it. */
2047
+ type WriteMetaOption<D extends ApiDescriptor, T extends TypeName<D>, Op extends RequestMetaOperation> = MetaOption<RequestMetaOf<D, T, Op>>;
2048
+ /** Whether write `Op` on type `T` must send its `meta`. */
2049
+ type RequiresWriteMeta<D extends ApiDescriptor, T extends TypeName<D>, Op extends RequestMetaOperation> = RequiresRequestMeta<RequestMetaOf<D, T, Op>>;
2050
+ /**
2051
+ * The arguments of type `T`'s delete: none when it declares no request `meta`, since it then takes
2052
+ * no body, else an options object carrying it, required when a member is.
2053
+ */
2054
+ type DeleteArgs<D extends ApiDescriptor, T extends TypeName<D>> = [RequestMetaOf<D, T, 'delete'>] extends [never] ? [] : OptionsArg<RequiresWriteMeta<D, T, 'delete'>, WriteMetaOption<D, T, 'delete'>>;
2055
+ /**
2056
+ * The top-level `meta` of the meta-only `200` relation `R`'s write with verb `V` answers with, or
2057
+ * `never` when it answers with the linkage.
2058
+ */
2059
+ type MutationMetaOf<D extends ApiDescriptor, T extends TypeName<D>, R extends RelationName<D, T>, V extends keyof RelationMutations> = D[T]['relations'][R] extends {
2060
+ mutationMeta: infer M;
2061
+ } ? V extends keyof M ? M[V] extends {
2062
+ fields: object;
2063
+ } ? DocumentMeta<M[V]> : never : never : never;
2064
+ /**
2065
+ * The top-level `meta` relation `R`'s write with verb `V` takes, or, with `Atomic`, the operation's
2066
+ * inside an atomic batch. `never` when it declares none.
2067
+ */
2068
+ type RelationRequestMetaOf<D extends ApiDescriptor, T extends TypeName<D>, R extends RelationName<D, T>, V extends keyof RelationMutations, Atomic extends boolean = false> = D[T]['relations'][R] extends { [K in Atomic extends true ? 'atomicRequestMeta' : 'requestMeta']: infer M } ? V extends keyof M ? M[V] extends {
2069
+ fields: object;
2070
+ } ? MetaObject<M[V]> : never : never : never;
2071
+ /**
2072
+ * The typed top-level `meta` of operation `Op` on type `T` (`fetchMany`, `fetchOne`, `create`,
2073
+ * `update` or `delete`), or `never` when its document declares none.
2074
+ */
2075
+ type OperationMeta<D extends ApiDescriptor, T extends TypeName<D>, Op extends DocumentMetaOperation> = D[T] extends {
2076
+ documentMeta: infer M;
2077
+ } ? Op extends keyof M ? M[Op] extends {
2078
+ fields: object;
2079
+ } ? DocumentMeta<M[Op]> : never : never : never;
2080
+ /** The typed top-level `meta` of relation `R`'s related read, or `never` when it declares none. */
2081
+ type RelatedMeta<D extends ApiDescriptor, T extends TypeName<D>, R extends RelationName<D, T>> = D[T]['relations'][R] extends {
2082
+ documentMeta: infer P extends {
2083
+ fields: object;
2084
+ };
2085
+ } ? DocumentMeta<P> : never;
2086
+ /** A declared `meta` type, or the loose record a document declaring none reads as. */
2087
+ type MetaOrLoose<M> = [M] extends [never] ? Record<string, unknown> | undefined : M;
2088
+ /** The `$meta` of type `T`'s collection read: its declared members, else the loose record. */
2089
+ type CollectionMeta<D extends ApiDescriptor, T extends TypeName<D>> = MetaOrLoose<OperationMeta<D, T, 'fetchMany'>>;
2090
+ /**
2091
+ * A single-resource result `R` whose document declares its top-level `meta` as `M`: its
2092
+ * `$document.meta` is typed `M`. `R` as it is when `M` is `never`.
2093
+ */
2094
+ type WithDocumentMeta<R, M> = [M] extends [never] ? R : R & {
2095
+ readonly $document: Omit<DocumentEnvelope, 'meta'> & {
2096
+ readonly meta: M;
2097
+ };
2098
+ };
2099
+ /**
2100
+ * What a delete of type `T` resolves to: the `meta` of the meta-only `200` it declares, which a
2101
+ * meta-only document always carries, else `void`.
2102
+ */
2103
+ type DeleteResult<D extends ApiDescriptor, T extends TypeName<D>> = [OperationMeta<D, T, 'delete'>] extends [never] ? void : NonNullable<OperationMeta<D, T, 'delete'>>;
1671
2104
  /**
1672
2105
  * A hydrated related VALUE for relation `R` of type `T`, resolved by cardinality over the
1673
2106
  * (possibly polymorphic) related type(s): a `Collection` of hydrated members for to-many,
1674
2107
  * the hydrated member (or `null`) for to-one. Each member's `$pivot` is typed from the
1675
2108
  * relation's `readPivot`.
1676
2109
  */
1677
- type RelatedValue<D extends ApiDescriptor, A, T extends TypeName<D>, R extends RelationName<D, T>, Q = undefined> = IsMany<D, T, R> extends true ? Collection<Hydrated<D, A, RelatedType<D, T, R>, unknown, PivotFieldsOf<D, T, R>>, RelationPage<D, T, R, Q>> : Hydrated<D, A, RelatedType<D, T, R>, unknown, PivotFieldsOf<D, T, R>> | null;
2110
+ type RelatedValue<D extends ApiDescriptor, A, T extends TypeName<D>, R extends RelationName<D, T>, Q = undefined> = IsMany<D, T, R> extends true ? Collection<Hydrated<D, A, RelatedType<D, T, R>, unknown, PivotFieldsOf<D, T, R>>, RelationPage<D, T, R, Q>, MetaOrLoose<RelatedMeta<D, T, R>>> : WithDocumentMeta<Hydrated<D, A, RelatedType<D, T, R>, unknown, PivotFieldsOf<D, T, R>>, RelatedMeta<D, T, R>> | null;
1678
2111
  /**
1679
2112
  * A linkage VALUE for relation `R` (the `/relationships/{rel}` endpoint, identifiers only):
1680
2113
  * a `Collection` of identifier members for to-many, a single identifier (or `null`) for to-one.
@@ -1714,6 +2147,23 @@ interface RelationshipAccessor<D extends ApiDescriptor, A, T extends TypeName<D>
1714
2147
  replace: RelationMutation<D, T, R, 'replace', readonly WriteRef<D, T, R>[]>;
1715
2148
  set: RelationMutation<D, T, R, 'set', LinkageRefOf<RelatedType<D, T, R>> | null>;
1716
2149
  }
2150
+ /**
2151
+ * True when relation `R` of type `T` takes verb `V`: it has the verb's cardinality, a to-one for
2152
+ * `set` and a to-many for the rest, and advertises the verb in its `mutations` flags, as the
2153
+ * relationship accessor gates it (see {@link AdvertisesVerb}).
2154
+ */
2155
+ type TakesVerb<D extends ApiDescriptor, T extends TypeName<D>, R extends RelationName<D, T>, V extends MutationVerb> = D[T]['relations'][R]['cardinality'] extends VerbCardinality<V> ? AdvertisesVerb<D, T, R, V> : false;
2156
+ /**
2157
+ * The relations of type `T` that take at least one verb (see {@link TakesVerb}), the names
2158
+ * {@link AtomicRecorder.rel} accepts.
2159
+ */
2160
+ type WritableRelationName<D extends ApiDescriptor, T extends TypeName<D>> = { [R in RelationName<D, T>]: true extends { [V in MutationVerb]: TakesVerb<D, T, R, V> }[MutationVerb] ? R : never }[RelationName<D, T>];
2161
+ /**
2162
+ * The members a relationship write with verb `V` on relation `R` takes, as the relationship
2163
+ * accessor's verbs take them: refs with an optional `$pivot` to add or replace, refs to remove, and
2164
+ * one ref or `null` to set.
2165
+ */
2166
+ type RelationshipMembers<D extends ApiDescriptor, T extends TypeName<D>, R extends RelationName<D, T>, V extends MutationVerb> = V extends 'set' ? LinkageRefOf<RelatedType<D, T, R>> | null : V extends 'remove' ? readonly LinkageRefOf<RelatedType<D, T, R>>[] : readonly WriteRef<D, T, R>[];
1717
2167
  /**
1718
2168
  * A linkage ref for a to-many membership WRITE on relation `R` (`add`/`replace`, or a create or
1719
2169
  * update input), with `$pivot` typed from the relation's `writePivot` — so a `belongsToMany` add
@@ -1765,7 +2215,12 @@ type AdvertisesVerb<D extends ApiDescriptor, T extends TypeName<D>, R extends Re
1765
2215
  * — or a verb the relation forbids (e.g. a to-many lacking `replace`) — is a compile error.
1766
2216
  * The result is the materialised linkage value or `void` (a `204` response).
1767
2217
  */
1768
- type RelationMutation<D extends ApiDescriptor, T extends TypeName<D>, R extends RelationName<D, T>, V extends MutationVerb, Refs> = D[T]['relations'][R]['cardinality'] extends VerbCardinality<V> ? AdvertisesVerb<D, T, R, V> extends true ? (refs: Refs) => Promise<LinkageValue<D, T, R> | void> : never : never;
2218
+ type RelationMutation<D extends ApiDescriptor, T extends TypeName<D>, R extends RelationName<D, T>, V extends MutationVerb, Refs> = D[T]['relations'][R]['cardinality'] extends VerbCardinality<V> ? AdvertisesVerb<D, T, R, V> extends true ? (refs: Refs, ...opts: OptionsArg<RequiresRequestMeta<RelationRequestMetaOf<D, T, R, V>>, MetaOption<RelationRequestMetaOf<D, T, R, V>>>) => Promise<MutationResult<D, T, R, V>> : never : never;
2219
+ /**
2220
+ * What relation `R`'s write with verb `V` resolves to: the `meta` of the meta-only `200` it
2221
+ * declares, else the materialised linkage, or `void` for a `204`.
2222
+ */
2223
+ type MutationResult<D extends ApiDescriptor, T extends TypeName<D>, R extends RelationName<D, T>, V extends MutationVerb> = [MutationMetaOf<D, T, R, V>] extends [never] ? LinkageValue<D, T, R> | void : NonNullable<MutationMetaOf<D, T, R, V>>;
1769
2224
  /** The relationship accessors of type `T`, keyed by relation name. */
1770
2225
  type RelationshipAccessors<D extends ApiDescriptor, A, T extends TypeName<D>> = { -readonly [R in keyof D[T]['relations'] as Extract<R, string>]: RelationshipAccessor<D, A, T, Extract<R, string>> };
1771
2226
  /**
@@ -1830,12 +2285,16 @@ type CreateId<D extends ApiDescriptor, T extends TypeName<D>> = D[T]['clientId']
1830
2285
  * slots, plus an `id` keyed by the client-id policy. The runtime builds the JSON:API
1831
2286
  * envelope (routing keys to attributes/relationships via the descriptor).
1832
2287
  */
1833
- type CreateInput<D extends ApiDescriptor, W, T extends TypeName<D>> = CreateAttributesOf<W, T> & RelationInputs<D, T> & CreateId<D, T>;
2288
+ type CreateInput<D extends ApiDescriptor, W, T extends TypeName<D>, Op extends 'create' | 'atomicCreate' = 'create'> = CreateAttributesOf<W, T> & RelationInputs<D, T> & CreateId<D, T> & {
2289
+ /** The resource object's `meta`, sent as `data.meta`. */$meta?: ResourceWriteMeta<D, T, Op>;
2290
+ };
1834
2291
  /**
1835
2292
  * The flat input to `client.<type>.id(id).update(patch)`: the type's update attributes (all
1836
2293
  * optional) + relation slots. The id rides the handle, never the input.
1837
2294
  */
1838
- type UpdateInput<D extends ApiDescriptor, W, T extends TypeName<D>> = UpdateAttributesOf<W, T> & RelationInputs<D, T>;
2295
+ type UpdateInput<D extends ApiDescriptor, W, T extends TypeName<D>, Op extends 'update' | 'atomicUpdate' = 'update'> = UpdateAttributesOf<W, T> & RelationInputs<D, T> & {
2296
+ /** The resource object's `meta`, sent as `data.meta`. */$meta?: ResourceWriteMeta<D, T, Op>;
2297
+ };
1839
2298
  /**
1840
2299
  * The flat input to a singleton's `client.<type>.update(input)`: the {@link UpdateInput} plus the
1841
2300
  * resource's `id`, which the request body must carry although the path has none. Take it from the
@@ -1878,12 +2337,18 @@ type AcceptedOf<D extends ApiDescriptor, T extends TypeName<D>, Op extends Accep
1878
2337
  type AcceptedJob<D extends ApiDescriptor, A, J> = J extends {
1879
2338
  jobType: infer JT extends string;
1880
2339
  } ? JT extends TypeName<D> ? ReadResult<D, A, JT> : Readonly<Record<string, unknown>> : never;
2340
+ /** The top-level `meta` of the job document an accepted write's `202` declares, else the loose record. */
2341
+ type AcceptedMeta<J> = J extends {
2342
+ meta: infer P extends {
2343
+ fields: object;
2344
+ };
2345
+ } ? DocumentMeta<P> : Record<string, unknown> | undefined;
1881
2346
  /**
1882
2347
  * What write `Op` on type `T` resolves to without waiting: its result `R`, or, when it declares a
1883
2348
  * `202`, `R` or an {@link Accepted} job whose poll resolves to the resource without the write's
1884
2349
  * `include` or `fields`.
1885
2350
  */
1886
- type WriteResult<D extends ApiDescriptor, A, T extends TypeName<D>, Op extends AcceptedOperation, R> = [AcceptedOf<D, T, Op>] extends [never] ? R : R | Accepted<AcceptedJob<D, A, AcceptedOf<D, T, Op>>, ReadResult<D, A, T>>;
2351
+ type WriteResult<D extends ApiDescriptor, A, T extends TypeName<D>, Op extends AcceptedOperation, R> = [AcceptedOf<D, T, Op>] extends [never] ? R : R | Accepted<AcceptedJob<D, A, AcceptedOf<D, T, Op>>, ReadResult<D, A, T>, AcceptedMeta<AcceptedOf<D, T, Op>>>;
1887
2352
  /**
1888
2353
  * The `wait` a caller may pass to write `Op` on type `T`: a boolean or {@link PollOptions} when it
1889
2354
  * declares a `202`, else nothing.
@@ -1899,21 +2364,21 @@ type WaitedWriteResult<D extends ApiDescriptor, A, T extends TypeName<D>, Op ext
1899
2364
  * accepted job and resolves to the created resource; without it the call may resolve to an
1900
2365
  * {@link Accepted}.
1901
2366
  */
1902
- type CreateMethod<D extends ApiDescriptor, A, W, T extends TypeName<D>> = [AcceptedOf<D, T, 'create'>] extends [never] ? <const Inc extends readonly IncludePath<D, T>[] = [], const F extends FieldsMap<D> = {}, const Cnt extends readonly ResourceCountToken<D, T, 'create'>[] = []>(input: CreateInput<D, W, T>, opts?: WriteOptions<D, T, Inc, F, 'create', Cnt>) => Promise<ReadResult<D, A, T, Inc, F, Cnt[number]>> : {
1903
- (input: CreateInput<D, W, T>, opts: WaitOptions): Promise<ReadResult<D, A, T>>;
1904
- <const Inc extends readonly IncludePath<D, T>[] = [], const F extends FieldsMap<D> = {}, const Cnt extends readonly ResourceCountToken<D, T, 'create'>[] = []>(input: CreateInput<D, W, T>, opts?: WriteOptions<D, T, Inc, F, 'create', Cnt> & {
2367
+ type CreateMethod<D extends ApiDescriptor, A, W, T extends TypeName<D>> = [AcceptedOf<D, T, 'create'>] extends [never] ? <const Inc extends readonly IncludePath<D, T>[] = [], const F extends FieldsMap<D> = {}, const Cnt extends readonly ResourceCountToken<D, T, 'create'>[] = []>(input: CreateInput<D, W, T>, ...opts: OptionsArg<RequiresWriteMeta<D, T, 'create'>, WriteOptions<D, T, Inc, F, 'create', Cnt> & WriteMetaOption<D, T, 'create'>>) => Promise<WithDocumentMeta<ReadResult<D, A, T, Inc, F, Cnt[number]>, OperationMeta<D, T, 'create'>>> : {
2368
+ (input: CreateInput<D, W, T>, opts: WaitOptions & WriteMetaOption<D, T, 'create'>): Promise<ReadResult<D, A, T>>;
2369
+ <const Inc extends readonly IncludePath<D, T>[] = [], const F extends FieldsMap<D> = {}, const Cnt extends readonly ResourceCountToken<D, T, 'create'>[] = []>(input: CreateInput<D, W, T>, ...opts: OptionsArg<RequiresWriteMeta<D, T, 'create'>, WriteOptions<D, T, Inc, F, 'create', Cnt> & {
1905
2370
  wait?: false;
1906
- }): Promise<WriteResult<D, A, T, 'create', ReadResult<D, A, T, Inc, F, Cnt[number]>>>;
2371
+ } & WriteMetaOption<D, T, 'create'>>): Promise<WriteResult<D, A, T, 'create', WithDocumentMeta<ReadResult<D, A, T, Inc, F, Cnt[number]>, OperationMeta<D, T, 'create'>>>>;
1907
2372
  };
1908
2373
  /**
1909
2374
  * `client.<type>.id(id).update`, which takes `wait` as {@link CreateMethod} does. `I` is the input
1910
2375
  * it takes: a singleton's update takes {@link SingletonUpdateInput}.
1911
2376
  */
1912
- type UpdateMethod<D extends ApiDescriptor, A, W, T extends TypeName<D>, I = UpdateInput<D, W, T>> = [AcceptedOf<D, T, 'update'>] extends [never] ? <const Inc extends readonly IncludePath<D, T>[] = [], const F extends FieldsMap<D> = {}, const Cnt extends readonly ResourceCountToken<D, T, 'update'>[] = []>(patch: I, opts?: WriteOptions<D, T, Inc, F, 'update', Cnt>) => Promise<ReadResult<D, A, T, Inc, F, Cnt[number]>> : {
1913
- (patch: I, opts: WaitOptions): Promise<ReadResult<D, A, T>>;
1914
- <const Inc extends readonly IncludePath<D, T>[] = [], const F extends FieldsMap<D> = {}, const Cnt extends readonly ResourceCountToken<D, T, 'update'>[] = []>(patch: I, opts?: WriteOptions<D, T, Inc, F, 'update', Cnt> & {
2377
+ type UpdateMethod<D extends ApiDescriptor, A, W, T extends TypeName<D>, I = UpdateInput<D, W, T>> = [AcceptedOf<D, T, 'update'>] extends [never] ? <const Inc extends readonly IncludePath<D, T>[] = [], const F extends FieldsMap<D> = {}, const Cnt extends readonly ResourceCountToken<D, T, 'update'>[] = []>(patch: I, ...opts: OptionsArg<RequiresWriteMeta<D, T, 'update'>, WriteOptions<D, T, Inc, F, 'update', Cnt> & WriteMetaOption<D, T, 'update'>>) => Promise<WithDocumentMeta<ReadResult<D, A, T, Inc, F, Cnt[number]>, OperationMeta<D, T, 'update'>>> : {
2378
+ (patch: I, opts: WaitOptions & WriteMetaOption<D, T, 'update'>): Promise<ReadResult<D, A, T>>;
2379
+ <const Inc extends readonly IncludePath<D, T>[] = [], const F extends FieldsMap<D> = {}, const Cnt extends readonly ResourceCountToken<D, T, 'update'>[] = []>(patch: I, ...opts: OptionsArg<RequiresWriteMeta<D, T, 'update'>, WriteOptions<D, T, Inc, F, 'update', Cnt> & {
1915
2380
  wait?: false;
1916
- }): Promise<WriteResult<D, A, T, 'update', ReadResult<D, A, T, Inc, F, Cnt[number]>>>;
2381
+ } & WriteMetaOption<D, T, 'update'>>): Promise<WriteResult<D, A, T, 'update', WithDocumentMeta<ReadResult<D, A, T, Inc, F, Cnt[number]>, OperationMeta<D, T, 'update'>>>>;
1917
2382
  };
1918
2383
  /**
1919
2384
  * The materialised positional result of a single atomic op handle:
@@ -1922,12 +2387,15 @@ type UpdateMethod<D extends ApiDescriptor, A, W, T extends TypeName<D>, I = Upda
1922
2387
  * wrapping the materialised resource view of `T` (the same {@link ResourceObjectView} a
1923
2388
  * standalone create/update read returns — `data` is typed, not `unknown`, plus the optional op
1924
2389
  * `meta`);
1925
- * - an {@link AtomicDeleteHandle} -> `undefined` (a remove carries no data).
2390
+ * - an {@link AtomicDeleteHandle} -> `undefined` (a remove carries no data);
2391
+ * - an {@link AtomicRelationshipHandle} for relation `R` of `T` -> the `AtomicResult` wrapping the
2392
+ * linkage the server answered with, as the relationship accessor's verbs return it, or
2393
+ * `undefined` data when it answered with an empty result.
1926
2394
  *
1927
2395
  * Drives the per-op positional typing of {@link AtomicResults} (the callback's returned tuple of
1928
2396
  * handles maps to a tuple of these).
1929
2397
  */
1930
- type AtomicResultOf<D extends ApiDescriptor, A, Handle> = Handle extends AtomicDeleteHandle ? undefined : Handle extends AtomicCreateHandle<infer T> ? T extends TypeName<D> ? AtomicResult<ResourceObjectView<D, A, T>> : never : Handle extends AtomicUpdateHandle<infer T> ? T extends TypeName<D> ? AtomicResult<ResourceObjectView<D, A, T>> : never : never;
2398
+ type AtomicResultOf<D extends ApiDescriptor, A, Handle> = Handle extends AtomicDeleteHandle ? undefined : Handle extends AtomicRelationshipHandle<infer T, infer R> ? T extends TypeName<D> ? R extends RelationName<D, T> ? AtomicResult<LinkageValue<D, T, R> | undefined> : never : never : Handle extends AtomicCreateHandle<infer T> ? T extends TypeName<D> ? AtomicResult<ResourceObjectView<D, A, T>> : never : Handle extends AtomicUpdateHandle<infer T> ? T extends TypeName<D> ? AtomicResult<ResourceObjectView<D, A, T>> : never : never;
1931
2399
  /** The custom actions declared on type `T` (the descriptor's `actions` block, or `{}`). */
1932
2400
  type ActionsOf<D extends ApiDescriptor, T extends TypeName<D>> = D[T] extends {
1933
2401
  actions: infer Acts;
@@ -1976,7 +2444,7 @@ type ActionValue<D extends ApiDescriptor, A, Act extends ActionDescriptor, E> =
1976
2444
  /** The {@link Accepted} job of an action that declares a `202`, or `never`. */
1977
2445
  type ActionAccepted<D extends ApiDescriptor, A, Act extends ActionDescriptor, E> = Act extends {
1978
2446
  accepted: object;
1979
- } ? Accepted<AcceptedJob<D, A, Act['accepted']>, ActionValue<D, A, Act, E>> : never;
2447
+ } ? Accepted<AcceptedJob<D, A, Act['accepted']>, ActionValue<D, A, Act, E>, AcceptedMeta<Act['accepted']>> : never;
1980
2448
  /** The `wait` option of an action that declares a `202`; `unknown` (adding nothing) otherwise. */
1981
2449
  type ActionWaitOption<Act> = Act extends {
1982
2450
  accepted: object;
@@ -1986,15 +2454,43 @@ type ActionWaitOption<Act> = Act extends {
1986
2454
  /** The value of an action's JSON:API answer other than a location document. */
1987
2455
  type ActionDocumentValue<D extends ApiDescriptor, A, Act extends ActionDescriptor, E> = Act extends {
1988
2456
  output: 'document';
1989
- } ? Act extends {
2457
+ } ? (Act extends {
1990
2458
  outputType: infer OT extends TypeName<D>;
1991
2459
  } ? Act extends {
1992
2460
  outputCardinality: 'many';
1993
- } ? Collection<ReadResult<D, A, OT>> : ReadResult<D, A, OT> : ActionOutputBody<E> : Act extends {
2461
+ } ? Collection<ReadResult<D, A, OT>, Page, MetaOrLoose<ActionDocumentMeta<Act>>> : WithDocumentMeta<ReadResult<D, A, OT>, ActionDocumentMeta<Act>> : ActionOutputBody<E>) | (Act extends {
2462
+ metaResult: true;
2463
+ } ? ActionStatusMeta<Act, '200'> : never) : Act extends {
1994
2464
  output: 'meta';
1995
- } ? Record<string, unknown> : Act extends {
2465
+ } ? ActionMetaOnly<Act> : Act extends {
1996
2466
  output: 'location';
1997
2467
  } ? never : void;
2468
+ /**
2469
+ * The `meta` of an action's meta-only document at status `S`, else the loose record. A meta-only
2470
+ * document always carries its `meta`.
2471
+ */
2472
+ type ActionStatusMeta<Act, S extends string> = Act extends {
2473
+ documentMeta: infer M;
2474
+ } ? S extends keyof M ? NonNullable<DocumentMeta<M[S]>> : Record<string, unknown> : Record<string, unknown>;
2475
+ /**
2476
+ * The typed `meta` of the resource documents an action answers with, a union over its statuses,
2477
+ * leaving out the meta-only `200` of a {@link ActionDescriptor.metaResult} action. `never` when
2478
+ * no status declares any.
2479
+ */
2480
+ type ActionDocumentMeta<Act> = Act extends {
2481
+ documentMeta: infer M;
2482
+ } ? { [S in Exclude<keyof M, Act extends {
2483
+ metaResult: true;
2484
+ } ? '200' : never>]: DocumentMeta<M[S]> }[Exclude<keyof M, Act extends {
2485
+ metaResult: true;
2486
+ } ? '200' : never>] : never;
2487
+ /**
2488
+ * The `meta` a meta-only action answers with: a union of what its statuses declare. A meta-only
2489
+ * document always carries its `meta`.
2490
+ */
2491
+ type ActionMetaOnly<Act> = Act extends {
2492
+ documentMeta: infer M;
2493
+ } ? { [S in keyof M]: NonNullable<DocumentMeta<M[S]>> }[keyof M] : Record<string, unknown>;
1998
2494
  /** The JSON:API media type, as the `accept` / `contentType` an action call names it by. */
1999
2495
  type JsonApiMediaType = 'application/vnd.api+json';
2000
2496
  /** How an action call reads a binary response: as a `Blob` (the default) or an `ArrayBuffer`. */
@@ -2025,6 +2521,8 @@ interface ActionCallOptions {
2025
2521
  relatedQuery?: LooseRelatedQuery;
2026
2522
  /** Poll a `202 Accepted` job until it's done, for an action that declares one. */
2027
2523
  wait?: boolean | PollOptions;
2524
+ /** The request document's top-level `meta`, for an action whose request declares it. */
2525
+ meta?: Readonly<Record<string, unknown>>;
2028
2526
  }
2029
2527
  /** A filter key a collection action accepts (its `filterable` literal union), or `never`. */
2030
2528
  type ActionFilterKey<Act> = Act extends {
@@ -2154,18 +2652,18 @@ type WithInput<D extends ApiDescriptor, W, Act, E> = Act extends {
2154
2652
  */
2155
2653
  type ActionMethod<D extends ApiDescriptor, A, W, Act extends ActionDescriptor, E> = Act extends {
2156
2654
  inputMedia: readonly InputMedia[];
2157
- } ? <const C extends ContentTypeOf<Act> = Extract<DefaultContentType<Act>, ContentTypeOf<Act>>, const M extends AcceptOf<Act> = Extract<DefaultAccept<Act>, AcceptOf<Act>>, RT extends BinaryResponseType = 'blob'>(input: InputBodyFor<D, W, Act, E, C>, options?: {
2655
+ } ? <const C extends ContentTypeOf<Act> = Extract<DefaultContentType<Act>, ContentTypeOf<Act>>, const M extends AcceptOf<Act> = Extract<DefaultAccept<Act>, AcceptOf<Act>>, RT extends BinaryResponseType = 'blob'>(input: InputBodyFor<D, W, Act, E, C>, ...options: ActionOptionsArg<Act, {
2158
2656
  signal?: AbortSignal;
2159
2657
  contentType?: C;
2160
- } & ResponseOptions<Act, M, RT> & ActionQueryOptions<D, Act> & ActionWaitOption<Act>) => ActionResultIn<D, A, Act, E, M, RT> : Act extends {
2658
+ } & ResponseOptions<Act, M, RT> & ActionQueryOptions<D, Act> & ActionWaitOption<Act>>) => ActionResultIn<D, A, Act, E, M, RT> : Act extends {
2161
2659
  rawOutput: readonly RawOutputMedia[];
2162
2660
  } ? Act extends {
2163
2661
  input: 'none';
2164
- } ? <const M extends AcceptOf<Act> = Extract<DefaultAccept<Act>, AcceptOf<Act>>, RT extends BinaryResponseType = 'blob'>(options?: {
2662
+ } ? <const M extends AcceptOf<Act> = Extract<DefaultAccept<Act>, AcceptOf<Act>>, RT extends BinaryResponseType = 'blob'>(...options: ActionOptionsArg<Act, {
2165
2663
  signal?: AbortSignal;
2166
- } & ResponseOptions<Act, M, RT> & ActionQueryOptions<D, Act> & ActionWaitOption<Act>) => ActionResultIn<D, A, Act, E, M, RT> : <const M extends AcceptOf<Act> = Extract<DefaultAccept<Act>, AcceptOf<Act>>, RT extends BinaryResponseType = 'blob'>(input: WithInput<D, W, Act, E>, options?: {
2664
+ } & ResponseOptions<Act, M, RT> & ActionQueryOptions<D, Act> & ActionWaitOption<Act>>) => ActionResultIn<D, A, Act, E, M, RT> : <const M extends AcceptOf<Act> = Extract<DefaultAccept<Act>, AcceptOf<Act>>, RT extends BinaryResponseType = 'blob'>(input: WithInput<D, W, Act, E>, ...options: ActionOptionsArg<Act, {
2167
2665
  signal?: AbortSignal;
2168
- } & ResponseOptions<Act, M, RT> & ActionQueryOptions<D, Act> & ActionWaitOption<Act>) => ActionResultIn<D, A, Act, E, M, RT> : Act extends {
2666
+ } & ResponseOptions<Act, M, RT> & ActionQueryOptions<D, Act> & ActionWaitOption<Act>>) => ActionResultIn<D, A, Act, E, M, RT> : Act extends {
2169
2667
  accepted: object;
2170
2668
  } ? AcceptedActionMethod<D, A, W, Act, E> : Act extends {
2171
2669
  filterable: readonly string[];
@@ -2173,13 +2671,15 @@ type ActionMethod<D extends ApiDescriptor, A, W, Act extends ActionDescriptor, E
2173
2671
  filterFamilies: readonly unknown[];
2174
2672
  } | {
2175
2673
  relatedQuery: true;
2674
+ } | {
2675
+ requestMeta: object;
2176
2676
  } ? Act extends {
2177
2677
  input: 'none';
2178
- } ? (options?: {
2678
+ } ? (...options: ActionOptionsArg<Act, {
2179
2679
  signal?: AbortSignal;
2180
- } & ActionQueryOptions<D, Act>) => ActionResult<D, A, Act, E> : (input: WithInput<D, W, Act, E>, options?: {
2680
+ } & ActionQueryOptions<D, Act>>) => ActionResult<D, A, Act, E> : (input: WithInput<D, W, Act, E>, ...options: ActionOptionsArg<Act, {
2181
2681
  signal?: AbortSignal;
2182
- } & ActionQueryOptions<D, Act>) => ActionResult<D, A, Act, E> : Act extends {
2682
+ } & ActionQueryOptions<D, Act>>) => ActionResult<D, A, Act, E> : Act extends {
2183
2683
  input: 'none';
2184
2684
  } ? () => ActionResult<D, A, Act, E> : (input: WithInput<D, W, Act, E>) => ActionResult<D, A, Act, E>;
2185
2685
  /**
@@ -2191,20 +2691,33 @@ type AcceptedActionMethod<D extends ApiDescriptor, A, W, Act extends ActionDescr
2191
2691
  } ? {
2192
2692
  (options: {
2193
2693
  signal?: AbortSignal;
2194
- } & ActionQueryOptions<D, Act> & WaitOptions): Promise<ActionValue<D, A, Act, E>>;
2195
- (options?: {
2694
+ } & ActionQueryOptions<D, Act> & WaitOptions & ActionMetaOption<Act>): Promise<ActionValue<D, A, Act, E>>;
2695
+ (...options: ActionOptionsArg<Act, {
2196
2696
  signal?: AbortSignal;
2197
2697
  wait?: false;
2198
- } & ActionQueryOptions<D, Act>): ActionResult<D, A, Act, E>;
2698
+ } & ActionQueryOptions<D, Act>>): ActionResult<D, A, Act, E>;
2199
2699
  } : {
2200
2700
  (input: WithInput<D, W, Act, E>, options: {
2201
2701
  signal?: AbortSignal;
2202
- } & ActionQueryOptions<D, Act> & WaitOptions): Promise<ActionValue<D, A, Act, E>>;
2203
- (input: WithInput<D, W, Act, E>, options?: {
2702
+ } & ActionQueryOptions<D, Act> & WaitOptions & ActionMetaOption<Act>): Promise<ActionValue<D, A, Act, E>>;
2703
+ (input: WithInput<D, W, Act, E>, ...options: ActionOptionsArg<Act, {
2204
2704
  signal?: AbortSignal;
2205
2705
  wait?: false;
2206
- } & ActionQueryOptions<D, Act>): ActionResult<D, A, Act, E>;
2706
+ } & ActionQueryOptions<D, Act>>): ActionResult<D, A, Act, E>;
2207
2707
  };
2708
+ /** The top-level `meta` an action's request document declares, or `never`. */
2709
+ type ActionRequestMeta<Act> = Act extends {
2710
+ requestMeta: infer P extends {
2711
+ fields: object;
2712
+ };
2713
+ } ? MetaObject<P> : never;
2714
+ /**
2715
+ * The `meta` option of an action whose request document declares it, required when a member is;
2716
+ * `unknown` (adding nothing) for one that declares none.
2717
+ */
2718
+ type ActionMetaOption<Act> = [ActionRequestMeta<Act>] extends [never] ? unknown : MetaOption<ActionRequestMeta<Act>>;
2719
+ /** An action's options argument: `O` and its `meta`, required when the action must send `meta`. */
2720
+ type ActionOptionsArg<Act, O> = OptionsArg<RequiresRequestMeta<ActionRequestMeta<Act>>, O & ActionMetaOption<Act>>;
2208
2721
  /**
2209
2722
  * The typed map of a type's custom actions at one scope (`collection` on the
2210
2723
  * {@link TypeAccessor}, `resource` on the {@link ResourceHandle}). Each entry is an
@@ -2224,9 +2737,13 @@ type ActionsAccessor<D extends ApiDescriptor, A, W, T extends TypeName<D>, Scope
2224
2737
  type ResourceHandle<D extends ApiDescriptor, A, W, T extends TypeName<D>, Act = DefaultActionTypes> = {
2225
2738
  readonly type: T;
2226
2739
  readonly id: string;
2227
- get<const Inc extends readonly IncludePath<D, T>[] = [], const F extends FieldsMap<D> = {}, const Cnt extends readonly ResourceCountToken<D, T, 'fetchOne'>[] = []>(query?: SingleReadQuery<D, T, Inc, F, Cnt>): Promise<ReadResult<D, A, T, Inc, F, Cnt[number]>>;
2740
+ get<const Inc extends readonly IncludePath<D, T>[] = [], const F extends FieldsMap<D> = {}, const Cnt extends readonly ResourceCountToken<D, T, 'fetchOne'>[] = []>(query?: SingleReadQuery<D, T, Inc, F, Cnt>): Promise<WithDocumentMeta<ReadResult<D, A, T, Inc, F, Cnt[number]>, OperationMeta<D, T, 'fetchOne'>>>;
2228
2741
  update: UpdateMethod<D, A, W, T>;
2229
- delete(): Promise<void>;
2742
+ /**
2743
+ * Resolves to the `meta` of the meta-only `200` the delete declares, else `undefined`. A delete
2744
+ * whose request document declares its `meta` takes it in the options.
2745
+ */
2746
+ delete(...opts: DeleteArgs<D, T>): Promise<DeleteResult<D, T>>;
2230
2747
  rel<R extends RelationName<D, T>>(name: R): RelationshipAccessor<D, A, T, R>; /** The type's resource-scoped custom actions, keyed by name (sub `{id}` from this handle). */
2231
2748
  readonly actions: ActionsAccessor<D, A, W, T, 'resource', Act>;
2232
2749
  } & RelationshipAccessors<D, A, T>;
@@ -2239,7 +2756,7 @@ type ResourceHandle<D extends ApiDescriptor, A, W, T extends TypeName<D>, Act =
2239
2756
  */
2240
2757
  type SingletonAccessor<D extends ApiDescriptor, A, W, T extends TypeName<D>, Act = DefaultActionTypes> = {
2241
2758
  readonly type: T;
2242
- get<const Inc extends readonly IncludePath<D, T>[] = [], const F extends FieldsMap<D> = {}, const Cnt extends readonly ResourceCountToken<D, T, 'fetchOne'>[] = []>(query?: SingleReadQuery<D, T, Inc, F, Cnt>): Promise<ReadResult<D, A, T, Inc, F, Cnt[number]>>;
2759
+ get<const Inc extends readonly IncludePath<D, T>[] = [], const F extends FieldsMap<D> = {}, const Cnt extends readonly ResourceCountToken<D, T, 'fetchOne'>[] = []>(query?: SingleReadQuery<D, T, Inc, F, Cnt>): Promise<WithDocumentMeta<ReadResult<D, A, T, Inc, F, Cnt[number]>, OperationMeta<D, T, 'fetchOne'>>>;
2243
2760
  update: UpdateMethod<D, A, W, T, SingletonUpdateInput<D, W, T>>;
2244
2761
  rel<R extends RelationName<D, T>>(name: R): RelationshipAccessor<D, A, T, R>; /** The type's resource-scoped custom actions, keyed by name. */
2245
2762
  readonly actions: ActionsAccessor<D, A, W, T, 'resource', Act>;
@@ -2250,8 +2767,8 @@ type IsSingleton<D extends ApiDescriptor, T extends TypeName<D>> = D[T] extends
2250
2767
  } ? true : false;
2251
2768
  /** The collection-scoped accessor for one wire type (`client.albums`). */
2252
2769
  interface TypeAccessor<D extends ApiDescriptor, A, W, T extends TypeName<D>, Act = DefaultActionTypes> {
2253
- list<const Inc extends readonly IncludePath<D, T>[] = [], const F extends FieldsMap<D> = {}, const Pg extends ListPageParams<D, T> | undefined = undefined, const Cnt extends readonly CountToken<D, T>[] = []>(query?: TypedReadQuery<D, T, Inc, F, Pg, Cnt>): Promise<Collection<ReadResult<D, A, T, Inc, F, Cnt[number]>, PageOf<D[T]['paginator'], Pg>>>;
2254
- get<const Inc extends readonly IncludePath<D, T>[] = [], const F extends FieldsMap<D> = {}, const Cnt extends readonly ResourceCountToken<D, T, 'fetchOne'>[] = []>(id: string, query?: SingleReadQuery<D, T, Inc, F, Cnt>): Promise<ReadResult<D, A, T, Inc, F, Cnt[number]>>;
2770
+ list<const Inc extends readonly IncludePath<D, T>[] = [], const F extends FieldsMap<D> = {}, const Pg extends ListPageParams<D, T> | undefined = undefined, const Cnt extends readonly CountToken<D, T>[] = []>(query?: TypedReadQuery<D, T, Inc, F, Pg, Cnt>): Promise<Collection<ReadResult<D, A, T, Inc, F, Cnt[number]>, PageOf<D[T]['paginator'], Pg>, CollectionMeta<D, T>>>;
2771
+ get<const Inc extends readonly IncludePath<D, T>[] = [], const F extends FieldsMap<D> = {}, const Cnt extends readonly ResourceCountToken<D, T, 'fetchOne'>[] = []>(id: string, query?: SingleReadQuery<D, T, Inc, F, Cnt>): Promise<WithDocumentMeta<ReadResult<D, A, T, Inc, F, Cnt[number]>, OperationMeta<D, T, 'fetchOne'>>>;
2255
2772
  create: CreateMethod<D, A, W, T>;
2256
2773
  id(id: string): ResourceHandle<D, A, W, T, Act>;
2257
2774
  /** The type's collection-scoped custom actions, keyed by name. */
@@ -2563,14 +3080,23 @@ interface WireResource {
2563
3080
  id?: string;
2564
3081
  [key: string]: unknown;
2565
3082
  }
3083
+ /**
3084
+ * What the request a resource answered tells a validator. `fields` is the sparse fieldset the
3085
+ * request sent for the resource's type, `fields[type]`, absent when it sent none.
3086
+ */
3087
+ interface ValidationContext {
3088
+ readonly fields?: readonly string[];
3089
+ }
2566
3090
  /**
2567
3091
  * The opt-in per-resource validator: validate one wire `resource` against its JSON `schema`
2568
3092
  * (the bundle's per-type resource-object schema). The engine is the user's — throw (or
2569
3093
  * aggregate-then-throw) on an invalid resource; return for a valid one. With the bare-function
2570
3094
  * seam form there is no per-type schema, so `schema` is `undefined` and the function owns the
2571
- * whole decision.
3095
+ * whole decision. With the schema-driven form, `schema` is already relaxed for the request's
3096
+ * sparse fieldset (see {@link sparseSchema}). `context` carries that fieldset either way, so a
3097
+ * bare validator can relax its own schema.
2572
3098
  */
2573
- type Validator = (resource: WireResource, schema: unknown) => void;
3099
+ type Validator = (resource: WireResource, schema: unknown, context?: ValidationContext) => void;
2574
3100
  /** A per-type JSON Schema map (the codegen-emitted `schemas` constant), keyed by JSON:API type. */
2575
3101
  type SchemaMap = Readonly<Record<string, unknown>>;
2576
3102
  /**
@@ -2588,9 +3114,12 @@ interface ValidationConfig {
2588
3114
  * `undefined`). Absent => no per-field validation (zero overhead, no engine dependency).
2589
3115
  */
2590
3116
  type ValidationOption = ValidationConfig | Validator;
2591
- /** A normalised validator: resolve a resource's schema (or `undefined`) and validate it. */
3117
+ /**
3118
+ * A normalised validator: resolve a resource's schema (or `undefined`) and validate it. `fields`
3119
+ * is the request's sparse fieldset for the resource's type, when it sent one.
3120
+ */
2592
3121
  interface ResolvedValidator {
2593
- validate(resource: WireResource): void;
3122
+ validate(resource: WireResource, fields?: readonly string[]): void;
2594
3123
  }
2595
3124
  /**
2596
3125
  * Normalise the `validate?` option to a single per-resource validator. The config form looks the
@@ -2599,6 +3128,21 @@ interface ResolvedValidator {
2599
3128
  * delegating the whole decision to the caller. Returns `undefined` when validation is off.
2600
3129
  */
2601
3130
  declare function resolveValidator(option: ValidationOption | undefined): ResolvedValidator | undefined;
3131
+ /**
3132
+ * A cache of {@link sparseSchema} results, by schema and fieldset, so each pair is relaxed once.
3133
+ * A schema with no fieldset comes back as it is.
3134
+ */
3135
+ declare function sparseSchemas(): (schema: unknown, fields: readonly string[] | undefined) => unknown;
3136
+ /**
3137
+ * A resource object schema relaxed for a response to a request whose sparse fieldset for the type
3138
+ * named `members`. An attribute or relation the fieldset leaves out is no longer required, and an
3139
+ * attribute it narrows to some of its keys, such as `address.city`, `location.geo.lat` or
3140
+ * `lines.*.sku`, requires only the keys selected at each level along those paths. A member the
3141
+ * fieldset also lists whole is left as declared, as the server renders it whole. Everything else
3142
+ * in the schema is kept, so a selected value is still checked, but for its `$id`: the copy is a
3143
+ * schema of its own.
3144
+ */
3145
+ declare function sparseSchema(schema: unknown, members: readonly string[]): unknown;
2602
3146
  /**
2603
3147
  * The light structural guards every parsed response passes through (ADR 0004): assert the body
2604
3148
  * is a JSON:API document and that each `data`/`included` member carries a string `type` (and,
@@ -2617,7 +3161,7 @@ declare function assertJsonApiDocument(body: unknown): asserts body is Document;
2617
3161
  * against its per-type schema. Called only when a validator is configured (off by default). The
2618
3162
  * structural guards have already proven each member carries `type`+`id`, so the cast is sound.
2619
3163
  */
2620
- declare function validateDocument(body: Document, validator: ResolvedValidator): void;
3164
+ declare function validateDocument(body: Document, validator: ResolvedValidator, fields?: Readonly<Record<string, readonly string[]>>): void;
2621
3165
  //#endregion
2622
- export { IdentifierMember as $, ActionInput as $n, readActionLocation as $t, AcceptedOf as A, materialise as An, StrategyDescriptor as Ar, ResourceCountToken as At, CountedRelationName as B, PageParams as Bn, TypedReadQuery as Bt, createClient as C, LinkObject as Cn, RelatedQueryOperation as Cr, RelationName as Ct, TransportResponse as D, RelationView as Dn, ResourceDescriptor as Dr, RelationSortQuery as Dt, TransportRequest as E, RelationArrayEnvelope as En, ResourceCountOperation as Er, RelationReadQuery as Et, BinaryResponseType as F, Page as Fn, SingletonUpdateInput as Ft, DefaultWriteAttributes as G, Accepted as Gn, WaitOptions as Gt, CreateMethod as H, ResolvedPaginator as Hn, TypedRelationReadQuery as Ht, Client as I, PageKeys as In, SortQuery as It, FieldSelectionMap as J, isAccepted as Jn, WithLinks as Jt, EdgeMembers as K, PollOptions as Kn, WaitValue as Kt, Collection as L, PageLinks as Ln, SortToken as Lt, ActionsAccessor as M, relatedPaginatorKind as Mn, ResourceObjectView as Mt, AtomicResultOf as N, CANONICAL_PAGE_KEYS as Nn, SingleReadQuery as Nt, fetchTransport as O, ResourceEnvelope as On, ResourceExamples as Or, RelationshipAccessor as Ot, BinaryBody as P, ExactPageParams as Pn, SingletonAccessor as Pt, HydratedMember as Q, ActionDescriptor as Qn, isActionLocation as Qt, CountAccessor as R, PageMeta as Rn, TypeAccessor as Rt, HeadersInit as S, Link as Sn, RelatedQueryDescriptor as Sr, RelationFilterQuery as St, TransportRawBody as T, NavigateOptions as Tn, RelationMutations as Tr, RelationPaginator as Tt, DefaultActionTypes as U, TypedPage as Un, UpdateInput as Ut, CreateInput as V, PageParamsOf as Vn, TypedRelatedReadQuery as Vt, DefaultAttributes as W, resolvePaginator as Wn, UpdateMethod as Wt, FilterKey as X, AcceptedDescriptor as Xn, WriteResult as Xt, FieldsMap as Y, parseRetryAfter as Yn, WriteOptions as Yt, FilterQuery as Z, AcceptedOperation as Zn, ActionLocation as Zt, executeRaw as _, mediaType as _n, PaginatorRole as _r, RelatedQueryEntry as _t, Validator as a, AtomicRef as an, AtomicDescriptor as ar, LinkageRef as at, ClientOptions as b, Edge as bn, RawMediaKind as br, RelatedReadRelatedQuery as bt, resolveValidator as c, AtomicUpdateHandle as cn, CountableDescriptor as cr, LooseRelatedQuery as ct, ExecutedResponse as d, ATOMIC_EXT as dn, InputMediaKind as dr, PivotInput as dt, AtomicCreateHandle as en, ActionLocationDescriptor as er, IncludePath as et, JsonApiContext as f, ATOMIC_MEDIA_TYPE as fn, MediaExamples as fr, ReadResult as ft, execute as g, ResourceIdentifier as gn, PaginatorKind as gr, RelatedQuery as gt, ReadQuery as h, MediaTypeParams as hn, PaginatorDescriptor as hr, RelatedIncludedType as ht, ValidationOption as i, AtomicRecorder as in, ApiExamples as ir, IsSingleton as it, ActionCallOptions as j, relatedPaginator as jn, isPolymorphic as jr, ResourceHandle as jt, AcceptedJob as k, ResourceLinks as kn, SortFamilyDescriptor as kr, ResourceAccessors as kt, validateDocument as l, AtomicUpdateInput as ln, FilterFamilyDescriptor as lr, LooseRelatedQueryEntry as lt, RawResponseType as m, LocalIdentifier as mn, OperationExamples as mr, RelatedIncludedResource as mt, SchemaMap as n, AtomicDeleteHandle as nn, ActionScope as nr, IncludedResource as nt, WireResource as o, AtomicResult as on, Cardinality as or, ListFilterMember as ot, JsonApiRequest as p, JSON_API_MEDIA_TYPE as pn, MenuDescriptor as pr, ReadableRelationName as pt, ErrorCodeOf as q, PollTimeoutError as qn, WaitedWriteResult as qt, ValidationConfig as r, AtomicHandle as rn, ApiDescriptor as rr, IncludedType as rt, assertJsonApiDocument as s, AtomicResults as sn, ClientIdPolicy as sr, ListPageParams as st, ResolvedValidator as t, AtomicCreateInput as tn, ActionOutput as tr, IncludedRelations as tt, Document as u, runAtomic as un, InputMedia as ur, MemberName as ut, executeResponse as v, ArrayEnvelope as vn, PaginatorStrategy as vr, RelatedQueryParam as vt, JsonApiTransport as w, MaterialiseContext as wn, RelationDescriptor as wr, RelationPageParams as wt, HANDLE_RESERVED as x, EdgeEnvelope as xn, RawOutputMedia as xr, RelationCollection as xt, serializeQuery as y, DocumentEnvelope as yn, PivotDescriptor as yr, RelatedQueryRelation as yt, CountToken as z, PageOf as zn, TypeName as zt };
2623
- //# sourceMappingURL=validate-BPV_qwZb.d.cts.map
3166
+ export { DocumentMeta as $, LinkObject as $n, PaginatorStrategy as $r, ResourceObjectView as $t, TransportResponse as A, AtomicOperationArgs as An, ActionDescriptor as Ar, RelatedIncludedType as At, Client as B, runAtomic as Bn, ClientIdPolicy as Br, RelationPageParams as Bt, ClientOptions as C, ActionLocation as Cn, Accepted as Cr, NestedFieldsetMember as Ct, JsonApiTransport as D, AtomicCreateInput as Dn, parseRetryAfter as Dr, ReadResult as Dt, createClient as E, AtomicCreateHandle as En, isAccepted as Er, PivotInput as Et, ActionCallOptions as F, AtomicRelationshipRecorder as Fn, AdditionalMembersDescriptor as Fr, RelatedQueryRelation as Ft, CountedRelationName as G, MediaTypeParams as Gn, InputMedia as Gr, RelationshipAccessor as Gt, CollectionMeta as H, ATOMIC_MEDIA_TYPE as Hn, DocumentMetaDescriptor as Hr, RelationReadQuery as Ht, ActionsAccessor as I, AtomicResult as In, ApiDescriptor as Ir, RelatedReadRelatedQuery as It, DefaultActionTypes as J, ArrayEnvelope as Jn, MenuDescriptor as Jr, RequiresRequestMeta as Jt, CreateInput as K, ResourceIdentifier as Kn, InputMediaKind as Kr, RelationshipMembers as Kt, AtomicResultOf as L, AtomicResults as Ln, ApiExamples as Lr, RelationCollection as Lt, AcceptedJob as M, AtomicRef as Mn, ActionLocationDescriptor as Mr, RelatedQuery as Mt, AcceptedMeta as N, AtomicRelationshipArgs as Nn, ActionOutput as Nr, RelatedQueryEntry as Nt, TransportRawBody as O, AtomicDeleteHandle as On, AcceptedDescriptor as Or, ReadableRelationName as Ot, AcceptedOf as P, AtomicRelationshipHandle as Pn, ActionScope as Pr, RelatedQueryParam as Pt, DeleteResult as Q, Link as Qn, PaginatorRole as Qr, ResourceMetaOf as Qt, BinaryBody as R, AtomicUpdateHandle as Rn, AtomicDescriptor as Rr, RelationFilterQuery as Rt, serializeQuery as S, WriteResult as Sn, resolvePaginator as Sr, MutationVerb as St, HeadersInit as T, readActionLocation as Tn, PollTimeoutError as Tr, OptionsArg as Tt, CountAccessor as U, JSON_API_MEDIA_TYPE as Un, DocumentMetaOperation as Ur, RelationRequestMetaOf as Ut, Collection as V, ATOMIC_EXT as Vn, CountableDescriptor as Vr, RelationPaginator as Vt, CountToken as W, LocalIdentifier as Wn, FilterFamilyDescriptor as Wr, RelationSortQuery as Wt, DefaultWriteAttributes as X, Edge as Xn, PaginatorDescriptor as Xr, ResourceCountToken as Xt, DefaultAttributes as Y, DocumentEnvelope as Yn, OperationExamples as Yr, ResourceAccessors as Yt, DeleteArgs as Z, EdgeEnvelope as Zn, PaginatorKind as Zr, ResourceHandle as Zt, RawResponseType as _, WaitedWriteResult as _n, PageOf as _r, LooseRelatedQueryEntry as _t, ValidationOption as a, RelationDescriptor as ai, SortQuery as an, ResourceLinks as ar, FilterQuery as at, executeRaw as b, WritableRelationName as bn, ResolvedPaginator as br, MetaOption as bt, assertJsonApiDocument as c, ResourceCountOperation as ci, TypeAccessor as cn, relatedPaginatorKind as cr, IncludePath as ct, sparseSchemas as d, ResourceMetaDescriptor as di, TypedRelatedReadQuery as dn, CANONICAL_PAGE_KEYS as dr, IncludedType as dt, PivotDescriptor as ei, ResourceWriteMeta as en, MaterialiseContext as er, EdgeMembers as et, validateDocument as f, SortFamilyDescriptor as fi, TypedRelationReadQuery as fn, ExactPageParams as fr, IsSingleton as ft, JsonApiRequest as g, WaitValue as gn, PageMeta as gr, LooseRelatedQuery as gt, JsonApiContext as h, WaitOptions as hn, PageLinks as hr, ListPageParams as ht, ValidationContext as i, RelatedQueryOperation as ii, SingletonUpdateInput as in, ResourceEnvelope as ir, FilterKey as it, fetchTransport as j, AtomicRecorder as jn, ActionInput as jr, RelatedMeta as jt, TransportRequest as k, AtomicHandle as kn, AcceptedOperation as kr, RelatedIncludedResource as kt, resolveValidator as l, ResourceDescriptor as li, TypeName as ln, NestedFieldset as lr, IncludedRelations as lt, ExecutedResponse as m, isPolymorphic as mi, UpdateMethod as mn, PageKeys as mr, ListFilterMember as mt, SchemaMap as n, RawOutputMedia as ni, SingleReadQuery as nn, RelationArrayEnvelope as nr, FieldSelectionMap as nt, Validator as o, RelationMutations as oi, SortToken as on, materialise as or, HydratedMember as ot, Document as p, StrategyDescriptor as pi, UpdateInput as pn, Page as pr, LinkageRef as pt, CreateMethod as q, mediaType as qn, MediaExamples as qr, RequestMetaOf as qt, ValidationConfig as r, RelatedQueryDescriptor as ri, SingletonAccessor as rn, RelationView as rr, FieldsMap as rt, WireResource as s, RequestMetaOperation as si, TakesVerb as sn, relatedPaginator as sr, IdentifierMember as st, ResolvedValidator as t, RawMediaKind as ti, ResourceWriteOperation as tn, NavigateOptions as tr, ErrorCodeOf as tt, sparseSchema as u, ResourceExamples as ui, TypedReadQuery as un, nestedFieldset as ur, IncludedResource as ut, ReadQuery as v, WithDocumentMeta as vn, PageParams as vr, MemberName as vt, HANDLE_RESERVED as w, isActionLocation as wn, PollOptions as wr, OperationMeta as wt, executeResponse as x, WriteOptions as xn, TypedPage as xr, MutationMetaOf as xt, execute as y, WithLinks as yn, PageParamsOf as yr, MetaObject as yt, BinaryResponseType as z, AtomicUpdateInput as zn, Cardinality as zr, RelationName as zt };
3167
+ //# sourceMappingURL=validate-CMy8mJD2.d.cts.map