@haddowg/json-api-client 1.20.0 → 1.22.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 +9 -6
- package/dist/ajv.d.cts +1 -1
- package/dist/ajv.d.mts +1 -1
- package/dist/index.cjs +73 -51
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +73 -51
- package/dist/index.mjs.map +1 -1
- package/dist/{validate-0UvXQg-n.d.cts → validate-Rgo7Zm0U.d.cts} +182 -81
- package/dist/validate-Rgo7Zm0U.d.cts.map +1 -0
- package/dist/{validate-0UvXQg-n.d.mts → validate-Rgo7Zm0U.d.mts} +182 -81
- package/dist/validate-Rgo7Zm0U.d.mts.map +1 -0
- package/package.json +1 -1
- package/dist/validate-0UvXQg-n.d.cts.map +0 -1
- package/dist/validate-0UvXQg-n.d.mts.map +0 -1
|
@@ -106,7 +106,8 @@ interface RelationDescriptor {
|
|
|
106
106
|
mutations?: RelationMutations;
|
|
107
107
|
/**
|
|
108
108
|
* The `withCount` count tokens + negotiation profile this relation's related/relationship reads
|
|
109
|
-
* advertise
|
|
109
|
+
* advertise: `_self_` on a to-many, and the relations of the related type it can count. Lets
|
|
110
|
+
* `.related()`/`.get()` send
|
|
110
111
|
* `withCount` and negotiate the right profile; absent when the relation advertises no Countable
|
|
111
112
|
* profile.
|
|
112
113
|
*/
|
|
@@ -157,6 +158,11 @@ interface RelationDescriptor {
|
|
|
157
158
|
listFilters?: readonly string[];
|
|
158
159
|
/** The filter families the relation's reads accept beside {@link filterable}. */
|
|
159
160
|
filterFamilies?: readonly FilterFamilyDescriptor[];
|
|
161
|
+
/**
|
|
162
|
+
* `true` when the related read takes `relatedQuery`, keyed by the relations of the related
|
|
163
|
+
* type's {@link ResourceDescriptor.relatedQuery}. Only a monomorphic relation's can.
|
|
164
|
+
*/
|
|
165
|
+
relatedQuery?: boolean;
|
|
160
166
|
}
|
|
161
167
|
/** A built-in pagination strategy. */
|
|
162
168
|
type PaginatorStrategy = 'page' | 'offset' | 'cursor' | 'fixed';
|
|
@@ -270,6 +276,11 @@ interface ActionDescriptor {
|
|
|
270
276
|
outputType?: string;
|
|
271
277
|
/** Whether a `document`-output action returns a single resource (`one`) or a collection (`many`). */
|
|
272
278
|
outputCardinality?: Cardinality;
|
|
279
|
+
/**
|
|
280
|
+
* `true` when the action takes `relatedQuery` for the resource it answers with, keyed by the
|
|
281
|
+
* relations of its {@link outputType}'s {@link ResourceDescriptor.relatedQuery}.
|
|
282
|
+
*/
|
|
283
|
+
relatedQuery?: boolean;
|
|
273
284
|
/**
|
|
274
285
|
* The declared request media type for a `raw`-input action (e.g. `application/octet-stream`),
|
|
275
286
|
* sent verbatim as the `Content-Type` so the server accepts the non-JSON:API body. Absent for
|
|
@@ -342,17 +353,30 @@ interface CountableDescriptor {
|
|
|
342
353
|
tokens: readonly string[];
|
|
343
354
|
profile: string;
|
|
344
355
|
}
|
|
345
|
-
/**
|
|
346
|
-
type
|
|
356
|
+
/** An operation answering with one resource that may take `withCount`. */
|
|
357
|
+
type ResourceCountOperation = 'fetchOne' | 'create' | 'update';
|
|
358
|
+
/**
|
|
359
|
+
* An operation of a type that takes `relatedQuery` for the resources it answers with: the
|
|
360
|
+
* collection read, the single-resource read, the create or the update.
|
|
361
|
+
*/
|
|
362
|
+
type RelatedQueryOperation = 'fetchMany' | 'fetchOne' | 'create' | 'update';
|
|
347
363
|
/**
|
|
348
|
-
* The `relatedQuery` parameter of a type
|
|
349
|
-
* and `sort` per
|
|
350
|
-
*
|
|
351
|
-
* server honours it, read from the
|
|
364
|
+
* The `relatedQuery` parameter for the resources of a type (the Relationship Queries profile): a
|
|
365
|
+
* `filter` and `sort` per relation, applied to that relationship's members. `relations` names the
|
|
366
|
+
* relations it addresses, `operations` names the type's own operations that take it, and
|
|
367
|
+
* `profile` is the URI a client negotiates in `Accept` before the server honours it, read from the
|
|
368
|
+
* parameter's `x-profile`. A related read or an action answering with resources of the type takes
|
|
369
|
+
* the same parameter when its {@link RelationDescriptor.relatedQuery} or
|
|
370
|
+
* {@link ActionDescriptor.relatedQuery} is `true`.
|
|
352
371
|
*/
|
|
353
372
|
interface RelatedQueryDescriptor {
|
|
354
373
|
operations: readonly RelatedQueryOperation[];
|
|
355
374
|
profile: string;
|
|
375
|
+
/**
|
|
376
|
+
* The relations an entry may be keyed by: the type's monomorphic relations a response renders.
|
|
377
|
+
* Absent in a descriptor that doesn't record them, which then takes any such relation.
|
|
378
|
+
*/
|
|
379
|
+
relations?: readonly string[];
|
|
356
380
|
}
|
|
357
381
|
/**
|
|
358
382
|
* A family of sort keys matched by prefix: any key of the form `<prefix>.<suffix>`, ascending or
|
|
@@ -387,8 +411,14 @@ interface ResourceDescriptor {
|
|
|
387
411
|
*/
|
|
388
412
|
countable?: CountableDescriptor;
|
|
389
413
|
/**
|
|
390
|
-
* The
|
|
391
|
-
*
|
|
414
|
+
* The `withCount` of the operations that answer with one resource, keyed `fetchOne`, `create`
|
|
415
|
+
* or `update`: the relations each can count and the profile it negotiates. An operation that
|
|
416
|
+
* documents no `withCount` has no entry, and the map is absent when none does.
|
|
417
|
+
*/
|
|
418
|
+
resourceCountable?: Readonly<Partial<Record<ResourceCountOperation, CountableDescriptor>>>;
|
|
419
|
+
/**
|
|
420
|
+
* The `relatedQuery` an operation answering with resources of this type takes, the operations
|
|
421
|
+
* of this type that take it, and the profile it needs. Absent when no operation documents it.
|
|
392
422
|
*/
|
|
393
423
|
relatedQuery?: RelatedQueryDescriptor;
|
|
394
424
|
/**
|
|
@@ -1202,10 +1232,11 @@ type RelationValue<D extends ApiDescriptor, A, T extends TypeName<D>, R extends
|
|
|
1202
1232
|
*/
|
|
1203
1233
|
type Relations<D extends ApiDescriptor, A, T extends TypeName<D>, Inc, F = unknown> = PickSelected<{ [R in ReadableRelationName<D, T>]: RelationValue<D, A, T, R, Inc, F> }, SelectedFields<F, T>>;
|
|
1204
1234
|
/**
|
|
1205
|
-
* The relations of type `T` a `withCount` read can count:
|
|
1206
|
-
*
|
|
1235
|
+
* The relations of type `T` a `withCount` read or write can count: the count tokens of its
|
|
1236
|
+
* collection read and of the operations answering with one resource, without `_self_`, which
|
|
1237
|
+
* counts the collection rather than a relation.
|
|
1207
1238
|
*/
|
|
1208
|
-
type CountedRelationName<D extends ApiDescriptor, T extends TypeName<D>> = Exclude<CountToken<D, T>, '_self_'>;
|
|
1239
|
+
type CountedRelationName<D extends ApiDescriptor, T extends TypeName<D>> = Exclude<CountToken<D, T> | ResourceCountToken<D, T, ResourceCountOperation>, '_self_'>;
|
|
1209
1240
|
/**
|
|
1210
1241
|
* The `$count` accessor of a resource object of type `T`: a relationship's `meta.total`, read
|
|
1211
1242
|
* from the raw relationship so it works when the relation carries no data. `Counted` names the
|
|
@@ -1281,6 +1312,16 @@ type CountToken<D extends ApiDescriptor, T extends TypeName<D>> = D[T] extends {
|
|
|
1281
1312
|
tokens: infer Tokens;
|
|
1282
1313
|
};
|
|
1283
1314
|
} ? Tokens extends readonly (infer Token)[] ? Token & string : never : never;
|
|
1315
|
+
/**
|
|
1316
|
+
* The relations operation `Op` of type `T` can count with `withCount`: the tokens its
|
|
1317
|
+
* `resourceCountable` entry lists, never `_self_`. `never` when the operation documents no
|
|
1318
|
+
* `withCount`, so `withCount` then takes only an empty list.
|
|
1319
|
+
*/
|
|
1320
|
+
type ResourceCountToken<D extends ApiDescriptor, T extends TypeName<D>, Op extends ResourceCountOperation> = Op extends ResourceCountOperation ? D[T] extends {
|
|
1321
|
+
resourceCountable: { [K in Op]: {
|
|
1322
|
+
tokens: infer Tokens;
|
|
1323
|
+
} };
|
|
1324
|
+
} ? Tokens extends readonly (infer Token)[] ? Exclude<Token & string, '_self_'> : never : never : never;
|
|
1284
1325
|
/**
|
|
1285
1326
|
* A sort token type `T`'s COLLECTION read accepts: its `sortable` literal union (signed field
|
|
1286
1327
|
* names like `title`/`-title`) plus, per sort family, `prefix.${string}` and `-prefix.${string}`.
|
|
@@ -1411,54 +1452,58 @@ type FieldsMap<D extends ApiDescriptor> = { [T in TypeName<D>]?: readonly Member
|
|
|
1411
1452
|
* names, so `fields` entries are constrained to real members.
|
|
1412
1453
|
*/
|
|
1413
1454
|
type MemberName<D extends ApiDescriptor, T extends TypeName<D>> = Extract<keyof D[T]['attributes'], string> | ReadableRelationName<D, T>;
|
|
1414
|
-
/** A `relatedQuery` entry for a path whose relation the types can't resolve. */
|
|
1415
|
-
interface LooseRelatedQueryEntry {
|
|
1416
|
-
filter?: Record<string, unknown>;
|
|
1417
|
-
sort?: string | readonly string[];
|
|
1418
|
-
}
|
|
1419
1455
|
/**
|
|
1420
1456
|
* The `relatedQuery` entry for relation `R` of type `T`: its `filter` and `sort` typed as the
|
|
1421
1457
|
* relation's own related read types them (see {@link RelationFilterQuery} and
|
|
1422
|
-
* {@link RelationSortQuery}).
|
|
1458
|
+
* {@link RelationSortQuery}). A to-one takes no `sort`.
|
|
1423
1459
|
*/
|
|
1424
1460
|
interface RelatedQueryEntry<D extends ApiDescriptor, T extends TypeName<D>, R extends RelationName<D, T>> {
|
|
1425
1461
|
filter?: RelationFilterQuery<D, T, R>;
|
|
1426
|
-
sort?: RelationSortQuery<D, T, R
|
|
1462
|
+
sort?: IsMany<D, T, R> extends true ? RelationSortQuery<D, T, R> : never;
|
|
1427
1463
|
}
|
|
1428
|
-
/** The
|
|
1429
|
-
type
|
|
1464
|
+
/** The relations of type `T` the client can tell are monomorphic. */
|
|
1465
|
+
type MonomorphicRelationName<D extends ApiDescriptor, T extends TypeName<D>> = { [R in ReadableRelationName<D, T>]: [MonomorphicTarget<D, RelationSpec<D, T, R>>] extends [never] ? never : R }[ReadableRelationName<D, T>];
|
|
1430
1466
|
/**
|
|
1431
|
-
* The
|
|
1432
|
-
*
|
|
1433
|
-
*
|
|
1467
|
+
* The relations a `relatedQuery` for resources of type `T` addresses: those the type's
|
|
1468
|
+
* `relatedQuery.relations` names, or, where the descriptor doesn't record them, its monomorphic
|
|
1469
|
+
* relations a response renders.
|
|
1434
1470
|
*/
|
|
1435
|
-
type
|
|
1436
|
-
|
|
1437
|
-
|
|
1471
|
+
type RelatedQueryRelation<D extends ApiDescriptor, T extends TypeName<D>> = D[T] extends {
|
|
1472
|
+
relatedQuery: {
|
|
1473
|
+
relations: readonly (infer R)[];
|
|
1474
|
+
};
|
|
1475
|
+
} ? Extract<R, RelationName<D, T>> : MonomorphicRelationName<D, T>;
|
|
1438
1476
|
/**
|
|
1439
|
-
* The `relatedQuery` object for type `T` (the Relationship Queries profile): keyed by
|
|
1440
|
-
*
|
|
1477
|
+
* The `relatedQuery` object for resources of type `T` (the Relationship Queries profile): keyed by
|
|
1478
|
+
* the relations it addresses, each entry a `filter`, and on a to-many a `sort`, applied to that
|
|
1479
|
+
* relationship's members.
|
|
1441
1480
|
*/
|
|
1442
|
-
type RelatedQuery<D extends ApiDescriptor, T extends TypeName<D>> = { readonly [
|
|
1481
|
+
type RelatedQuery<D extends ApiDescriptor, T extends TypeName<D>> = { readonly [R in RelatedQueryRelation<D, T>]?: RelatedQueryEntry<D, T, R> };
|
|
1443
1482
|
/**
|
|
1444
|
-
* The `relatedQuery`
|
|
1445
|
-
* descriptor names the
|
|
1483
|
+
* The `relatedQuery` operation `Op` of type `T` takes: {@link RelatedQuery} when the type's
|
|
1484
|
+
* descriptor names the operation in `relatedQuery.operations`, else `never`, so it can't be sent.
|
|
1446
1485
|
*/
|
|
1447
1486
|
type RelatedQueryParam<D extends ApiDescriptor, T extends TypeName<D>, Op extends RelatedQueryOperation> = D[T] extends {
|
|
1448
1487
|
relatedQuery: {
|
|
1449
1488
|
operations: readonly (infer O)[];
|
|
1450
1489
|
};
|
|
1451
1490
|
} ? Op extends O ? RelatedQuery<D, T> : never : never;
|
|
1491
|
+
/**
|
|
1492
|
+
* The `relatedQuery` relation `R`'s related read takes: {@link RelatedQuery} for its related type
|
|
1493
|
+
* when the relation's descriptor marks `relatedQuery`, else `never`.
|
|
1494
|
+
*/
|
|
1495
|
+
type RelatedReadRelatedQuery<D extends ApiDescriptor, T extends TypeName<D>, R extends RelationName<D, T>> = RelationSpec<D, T, R> extends {
|
|
1496
|
+
relatedQuery: true;
|
|
1497
|
+
} ? MonomorphicTarget<D, RelationSpec<D, T, R>> extends infer U extends TypeName<D> ? [U] extends [never] ? never : RelatedQuery<D, U> : never : never;
|
|
1452
1498
|
/** The `page` argument a collection read of type `T` accepts (see {@link PageParams}). */
|
|
1453
1499
|
type ListPageParams<D extends ApiDescriptor, T extends TypeName<D>> = PageParams<D[T]['paginator']>;
|
|
1454
1500
|
/**
|
|
1455
1501
|
* A read query carrying a typed, narrowing `include`, a typed `fields` (drives sparse-fieldset
|
|
1456
1502
|
* return narrowing), a `withCount` constrained to the type's count tokens (`Cnt` drives `$count`
|
|
1457
1503
|
* narrowing), a `page` typed by the collection's paginator (`Pg` drives the `$page` type), a
|
|
1458
|
-
* `relatedQuery` keyed by
|
|
1504
|
+
* `relatedQuery` keyed by relation name, plus the loose JSON:API query families. `Inc`/`F`/`Cnt`
|
|
1459
1505
|
* are inferred (as `const`) at the call site. Used for the COLLECTION read (`list`); the
|
|
1460
|
-
* single-resource read (`get`) uses {@link SingleReadQuery}
|
|
1461
|
-
* `GET /{type}/{id}` endpoint advertises it).
|
|
1506
|
+
* single-resource read (`get`) uses {@link SingleReadQuery}.
|
|
1462
1507
|
*/
|
|
1463
1508
|
interface TypedReadQuery<D extends ApiDescriptor, T extends TypeName<D>, Inc extends readonly IncludePath<D, T>[], F extends FieldsMap<D> = FieldsMap<D>, Pg extends ListPageParams<D, T> | undefined = ListPageParams<D, T> | undefined, Cnt extends readonly CountToken<D, T>[] = readonly CountToken<D, T>[]> {
|
|
1464
1509
|
/** The relations to include — drives static narrowing; constrained to the advertised paths. */
|
|
@@ -1475,8 +1520,8 @@ interface TypedReadQuery<D extends ApiDescriptor, T extends TypeName<D>, Inc ext
|
|
|
1475
1520
|
*/
|
|
1476
1521
|
withCount?: Cnt;
|
|
1477
1522
|
/**
|
|
1478
|
-
* A `filter` and `sort` per
|
|
1479
|
-
*
|
|
1523
|
+
* A `filter` and `sort` per relation, applied to that relationship (the Relationship Queries
|
|
1524
|
+
* profile). Present only when the collection read advertises it.
|
|
1480
1525
|
*/
|
|
1481
1526
|
relatedQuery?: RelatedQueryParam<D, T, 'fetchMany'>;
|
|
1482
1527
|
/**
|
|
@@ -1489,19 +1534,24 @@ interface TypedReadQuery<D extends ApiDescriptor, T extends TypeName<D>, Inc ext
|
|
|
1489
1534
|
}
|
|
1490
1535
|
/**
|
|
1491
1536
|
* A single-resource read query (`GET /{type}/{id}`): `include`, sparse `fields` and, where the
|
|
1492
|
-
* read advertises
|
|
1493
|
-
* `sort`/`filter`/`page` (no collection to order, filter or page)
|
|
1494
|
-
*
|
|
1495
|
-
* under strict query-param validation).
|
|
1537
|
+
* read advertises them, `withCount` and `relatedQuery`. A single-resource endpoint advertises no
|
|
1538
|
+
* `sort`/`filter`/`page` (no collection to order, filter or page), and its `withCount` counts
|
|
1539
|
+
* relations only, never `_self_`; accepting more would be a lying type (the server rejects an
|
|
1540
|
+
* unrecognised parameter with `400` under strict query-param validation).
|
|
1496
1541
|
*/
|
|
1497
|
-
interface SingleReadQuery<D extends ApiDescriptor, T extends TypeName<D>, Inc extends readonly IncludePath<D, T>[], F extends FieldsMap<D> = FieldsMap<D
|
|
1542
|
+
interface SingleReadQuery<D extends ApiDescriptor, T extends TypeName<D>, Inc extends readonly IncludePath<D, T>[], F extends FieldsMap<D> = FieldsMap<D>, Cnt extends readonly ResourceCountToken<D, T, 'fetchOne'>[] = readonly ResourceCountToken<D, T, 'fetchOne'>[]> {
|
|
1498
1543
|
/** The relations to include — drives static narrowing; constrained to the advertised paths. */
|
|
1499
1544
|
include?: Inc;
|
|
1500
1545
|
/** Sparse fieldsets per type — drives return-type narrowing (unrequested members are absent). */
|
|
1501
1546
|
fields?: F;
|
|
1502
1547
|
/**
|
|
1503
|
-
*
|
|
1504
|
-
*
|
|
1548
|
+
* The relations to count (the Countable profile), comma-joined onto `withCount`. Each reads back
|
|
1549
|
+
* as a `number` from `$count` on the resource. Present only when the read advertises it.
|
|
1550
|
+
*/
|
|
1551
|
+
withCount?: Cnt;
|
|
1552
|
+
/**
|
|
1553
|
+
* A `filter` and `sort` per relation, applied to that relationship (the Relationship Queries
|
|
1554
|
+
* profile). Present only when the single-resource read advertises it.
|
|
1505
1555
|
*/
|
|
1506
1556
|
relatedQuery?: RelatedQueryParam<D, T, 'fetchOne'>;
|
|
1507
1557
|
/** Cancels the read when signalled (e.g. a superseded request). Not sent to the server. */
|
|
@@ -1513,24 +1563,37 @@ interface SingleReadQuery<D extends ApiDescriptor, T extends TypeName<D>, Inc ex
|
|
|
1513
1563
|
* narrowed to the requested sparse fieldset. `Counted` names the relations the read counted.
|
|
1514
1564
|
*/
|
|
1515
1565
|
type ReadResult<D extends ApiDescriptor, A, T extends TypeName<D>, Inc extends readonly IncludePath<D, T>[] = [], F = unknown, Counted = never> = ResourceObjectView<D, A, T, IncludedRelations<D, T, Inc>, F, Counted>;
|
|
1566
|
+
/** A `relatedQuery` whose relations and vocabularies the types don't know. */
|
|
1567
|
+
type LooseRelatedQuery = Readonly<Record<string, {
|
|
1568
|
+
filter?: Record<string, unknown>;
|
|
1569
|
+
sort?: string | readonly string[];
|
|
1570
|
+
} | undefined>>;
|
|
1571
|
+
/** @deprecated Use the entry type of {@link LooseRelatedQuery}. */
|
|
1572
|
+
type LooseRelatedQueryEntry = NonNullable<LooseRelatedQuery[string]>;
|
|
1516
1573
|
/**
|
|
1517
1574
|
* A read query for the relationship/related endpoints: loose include/fields/withCount, a `page` of
|
|
1518
|
-
* type `Pg` (typed from the relation's paginator on a typed accessor),
|
|
1519
|
-
*
|
|
1520
|
-
*
|
|
1575
|
+
* type `Pg` (typed from the relation's paginator on a typed accessor), a `sort` of type `S` and a
|
|
1576
|
+
* `filter` of type `F`, which a typed accessor narrows to what the relation's reads take (see
|
|
1577
|
+
* {@link RelationSortQuery} and {@link RelationFilterQuery}), and a `relatedQuery` of type `RQ`,
|
|
1578
|
+
* which a typed related read narrows to its related type's (see {@link RelatedReadRelatedQuery}).
|
|
1521
1579
|
*/
|
|
1522
|
-
interface RelationReadQuery<Pg = Readonly<Record<string, unknown>>, S = string | readonly string[], F = Record<string, unknown
|
|
1580
|
+
interface RelationReadQuery<Pg = Readonly<Record<string, unknown>>, S = string | readonly string[], F = Record<string, unknown>, RQ = LooseRelatedQuery> {
|
|
1523
1581
|
filter?: F;
|
|
1524
1582
|
sort?: S;
|
|
1525
1583
|
include?: readonly string[];
|
|
1526
1584
|
fields?: Record<string, readonly string[]>;
|
|
1527
1585
|
page?: Pg;
|
|
1528
1586
|
/**
|
|
1529
|
-
* Relationship-count tokens (`_self_`
|
|
1587
|
+
* Relationship-count tokens (`_self_` on a to-many, and the related type's countable relations) — the related/
|
|
1530
1588
|
* relationship endpoints advertise their own `withCount`, and the client negotiates the
|
|
1531
1589
|
* relation's Countable profile so a strict server accepts it.
|
|
1532
1590
|
*/
|
|
1533
1591
|
withCount?: readonly string[];
|
|
1592
|
+
/**
|
|
1593
|
+
* A `filter` and `sort` per relation of the related resources (the Relationship Queries
|
|
1594
|
+
* profile). A related read of a monomorphic relation may take it; a relationship read never does.
|
|
1595
|
+
*/
|
|
1596
|
+
relatedQuery?: RQ;
|
|
1534
1597
|
/** Cancels the read when signalled (e.g. a superseded request). Not sent to the server. */
|
|
1535
1598
|
signal?: AbortSignal;
|
|
1536
1599
|
}
|
|
@@ -1602,10 +1665,15 @@ type RelatedValue<D extends ApiDescriptor, A, T extends TypeName<D>, R extends R
|
|
|
1602
1665
|
*/
|
|
1603
1666
|
type LinkageValue<D extends ApiDescriptor, T extends TypeName<D>, R extends RelationName<D, T>, Q = undefined> = IsMany<D, T, R> extends true ? Collection<Identifier<RelatedType<D, T, R>, PivotFieldsOf<D, T, R>, EdgeMetaOf<D, T, R>>, RelationPage<D, T, R, Q>> : Identifier<RelatedType<D, T, R>, PivotFieldsOf<D, T, R>, EdgeMetaOf<D, T, R>> | null;
|
|
1604
1667
|
/**
|
|
1605
|
-
* The query relation `R`'s
|
|
1606
|
-
*
|
|
1668
|
+
* The query relation `R`'s relationship read takes, its `sort` and `filter` narrowed to what the
|
|
1669
|
+
* relation declares and its `page` of type `Pg`. It takes no `relatedQuery`.
|
|
1607
1670
|
*/
|
|
1608
|
-
type TypedRelationReadQuery<D extends ApiDescriptor, T extends TypeName<D>, R extends RelationName<D, T>, Pg = Readonly<Record<string, unknown>>> = RelationReadQuery<Pg, RelationSortQuery<D, T, R>, RelationFilterQuery<D, T, R
|
|
1671
|
+
type TypedRelationReadQuery<D extends ApiDescriptor, T extends TypeName<D>, R extends RelationName<D, T>, Pg = Readonly<Record<string, unknown>>> = RelationReadQuery<Pg, RelationSortQuery<D, T, R>, RelationFilterQuery<D, T, R>, never>;
|
|
1672
|
+
/**
|
|
1673
|
+
* The query relation `R`'s related read takes: a {@link TypedRelationReadQuery} that also takes
|
|
1674
|
+
* the `relatedQuery` of its related type where the relation's descriptor marks it.
|
|
1675
|
+
*/
|
|
1676
|
+
type TypedRelatedReadQuery<D extends ApiDescriptor, T extends TypeName<D>, R extends RelationName<D, T>, Pg = Readonly<Record<string, unknown>>> = RelationReadQuery<Pg, RelationSortQuery<D, T, R>, RelationFilterQuery<D, T, R>, RelatedReadRelatedQuery<D, T, R>>;
|
|
1609
1677
|
/** The `page` argument relation `R`'s to-many reads accept; `never` for a to-one. */
|
|
1610
1678
|
type RelationPageParams<D extends ApiDescriptor, T extends TypeName<D>, R extends RelationName<D, T>> = IsMany<D, T, R> extends true ? PageParams<RelationPaginator<D, T, R>> : never;
|
|
1611
1679
|
/**
|
|
@@ -1622,7 +1690,7 @@ type RelationPageParams<D extends ApiDescriptor, T extends TypeName<D>, R extend
|
|
|
1622
1690
|
*/
|
|
1623
1691
|
interface RelationshipAccessor<D extends ApiDescriptor, A, T extends TypeName<D>, R extends RelationName<D, T>> {
|
|
1624
1692
|
get: ReadsRelationship<D, T, R> extends true ? <const Pg extends RelationPageParams<D, T, R> | undefined = undefined>(query?: TypedRelationReadQuery<D, T, R, ExactPageParams<Pg, RelationPageParams<D, T, R>>>) => Promise<LinkageValue<D, T, R, Pg>> : never;
|
|
1625
|
-
related: ExposesRelated<D, T, R> extends true ? <const Pg extends RelationPageParams<D, T, R> | undefined = undefined>(query?:
|
|
1693
|
+
related: ExposesRelated<D, T, R> extends true ? <const Pg extends RelationPageParams<D, T, R> | undefined = undefined>(query?: TypedRelatedReadQuery<D, T, R, ExactPageParams<Pg, RelationPageParams<D, T, R>>>) => Promise<RelatedValue<D, A, T, R, Pg>> : never;
|
|
1626
1694
|
add: RelationMutation<D, T, R, 'add', readonly WriteRef<D, T, R>[]>;
|
|
1627
1695
|
remove: RelationMutation<D, T, R, 'remove', readonly LinkageRefOf<RelatedType<D, T, R>>[]>;
|
|
1628
1696
|
replace: RelationMutation<D, T, R, 'replace', readonly WriteRef<D, T, R>[]>;
|
|
@@ -1750,11 +1818,24 @@ type CreateInput<D extends ApiDescriptor, W, T extends TypeName<D>> = CreateAttr
|
|
|
1750
1818
|
* optional) + relation slots. The id rides the handle, never the input.
|
|
1751
1819
|
*/
|
|
1752
1820
|
type UpdateInput<D extends ApiDescriptor, W, T extends TypeName<D>> = UpdateAttributesOf<W, T> & RelationInputs<D, T>;
|
|
1753
|
-
/**
|
|
1754
|
-
|
|
1821
|
+
/**
|
|
1822
|
+
* Options for a create/update write: an optional `include`/`fields` narrowing the materialised
|
|
1823
|
+
* response, and the `withCount` write `Op` advertises.
|
|
1824
|
+
*/
|
|
1825
|
+
interface WriteOptions<D extends ApiDescriptor, T extends TypeName<D>, Inc extends readonly IncludePath<D, T>[] = [], F extends FieldsMap<D> = FieldsMap<D>, Op extends AcceptedOperation = AcceptedOperation, Cnt extends readonly ResourceCountToken<D, T, Op>[] = readonly ResourceCountToken<D, T, Op>[]> {
|
|
1755
1826
|
include?: Inc;
|
|
1756
1827
|
/** Sparse fieldsets per type — narrows the materialised write response. */
|
|
1757
1828
|
fields?: F;
|
|
1829
|
+
/**
|
|
1830
|
+
* The relations to count (the Countable profile), comma-joined onto `withCount`. Each reads back
|
|
1831
|
+
* as a `number` from `$count` on the written resource. Present only when the write advertises it.
|
|
1832
|
+
*/
|
|
1833
|
+
withCount?: Cnt;
|
|
1834
|
+
/**
|
|
1835
|
+
* A `filter` and `sort` per relation of the written resource (the Relationship Queries
|
|
1836
|
+
* profile). Present only when the write advertises it.
|
|
1837
|
+
*/
|
|
1838
|
+
relatedQuery?: RelatedQueryParam<D, T, Op>;
|
|
1758
1839
|
}
|
|
1759
1840
|
/** The options that make a write wait for an accepted job: `true`, or the {@link PollOptions}. */
|
|
1760
1841
|
interface WaitOptions {
|
|
@@ -1792,18 +1873,18 @@ type WaitedWriteResult<D extends ApiDescriptor, A, T extends TypeName<D>, Op ext
|
|
|
1792
1873
|
* accepted job and resolves to the created resource; without it the call may resolve to an
|
|
1793
1874
|
* {@link Accepted}.
|
|
1794
1875
|
*/
|
|
1795
|
-
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> = {}>(input: CreateInput<D, W, T>, opts?: WriteOptions<D, T, Inc, F>) => Promise<ReadResult<D, A, T, Inc, F>> : {
|
|
1876
|
+
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]>> : {
|
|
1796
1877
|
(input: CreateInput<D, W, T>, opts: WaitOptions): Promise<ReadResult<D, A, T>>;
|
|
1797
|
-
<const Inc extends readonly IncludePath<D, T>[] = [], const F extends FieldsMap<D> = {}>(input: CreateInput<D, W, T>, opts?: WriteOptions<D, T, Inc, F> & {
|
|
1878
|
+
<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> & {
|
|
1798
1879
|
wait?: false;
|
|
1799
|
-
}): Promise<WriteResult<D, A, T, 'create', ReadResult<D, A, T, Inc, F>>>;
|
|
1880
|
+
}): Promise<WriteResult<D, A, T, 'create', ReadResult<D, A, T, Inc, F, Cnt[number]>>>;
|
|
1800
1881
|
};
|
|
1801
1882
|
/** `client.<type>.id(id).update`, which takes `wait` as {@link CreateMethod} does. */
|
|
1802
|
-
type UpdateMethod<D extends ApiDescriptor, A, W, T extends TypeName<D>> = [AcceptedOf<D, T, 'update'>] extends [never] ? <const Inc extends readonly IncludePath<D, T>[] = [], const F extends FieldsMap<D> = {}>(patch: UpdateInput<D, W, T>, opts?: WriteOptions<D, T, Inc, F>) => Promise<ReadResult<D, A, T, Inc, F>> : {
|
|
1883
|
+
type UpdateMethod<D extends ApiDescriptor, A, W, T extends TypeName<D>> = [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: UpdateInput<D, W, T>, opts?: WriteOptions<D, T, Inc, F, 'update', Cnt>) => Promise<ReadResult<D, A, T, Inc, F, Cnt[number]>> : {
|
|
1803
1884
|
(patch: UpdateInput<D, W, T>, opts: WaitOptions): Promise<ReadResult<D, A, T>>;
|
|
1804
|
-
<const Inc extends readonly IncludePath<D, T>[] = [], const F extends FieldsMap<D> = {}>(patch: UpdateInput<D, W, T>, opts?: WriteOptions<D, T, Inc, F> & {
|
|
1885
|
+
<const Inc extends readonly IncludePath<D, T>[] = [], const F extends FieldsMap<D> = {}, const Cnt extends readonly ResourceCountToken<D, T, 'update'>[] = []>(patch: UpdateInput<D, W, T>, opts?: WriteOptions<D, T, Inc, F, 'update', Cnt> & {
|
|
1805
1886
|
wait?: false;
|
|
1806
|
-
}): Promise<WriteResult<D, A, T, 'update', ReadResult<D, A, T, Inc, F>>>;
|
|
1887
|
+
}): Promise<WriteResult<D, A, T, 'update', ReadResult<D, A, T, Inc, F, Cnt[number]>>>;
|
|
1807
1888
|
};
|
|
1808
1889
|
/**
|
|
1809
1890
|
* The materialised positional result of a single atomic op handle:
|
|
@@ -1908,6 +1989,11 @@ interface ActionCallOptions {
|
|
|
1908
1989
|
responseType?: BinaryResponseType;
|
|
1909
1990
|
/** The filters of a collection action that takes them, sent as `filter[...]` like a read's. */
|
|
1910
1991
|
filter?: Readonly<Record<string, unknown>>;
|
|
1992
|
+
/**
|
|
1993
|
+
* A `filter` and `sort` per relation of the resource the action answers with (the Relationship
|
|
1994
|
+
* Queries profile), for an action that takes it.
|
|
1995
|
+
*/
|
|
1996
|
+
relatedQuery?: LooseRelatedQuery;
|
|
1911
1997
|
/** Poll a `202 Accepted` job until it's done, for an action that declares one. */
|
|
1912
1998
|
wait?: boolean | PollOptions;
|
|
1913
1999
|
}
|
|
@@ -1922,6 +2008,18 @@ type ActionFilterKey<Act> = Act extends {
|
|
|
1922
2008
|
type ActionFilterOptions<Act> = [ActionFilterKey<Act> | FilterFamilyPrefixOf<Act>] extends [never] ? unknown : {
|
|
1923
2009
|
filter?: FiltersOf<Act, ActionFilterKey<Act>>;
|
|
1924
2010
|
};
|
|
2011
|
+
/**
|
|
2012
|
+
* The `relatedQuery` option of an action that takes it, typed by its output type's
|
|
2013
|
+
* {@link RelatedQuery}; `unknown` (adding nothing) for one that takes none.
|
|
2014
|
+
*/
|
|
2015
|
+
type ActionRelatedQueryOptions<D extends ApiDescriptor, Act> = Act extends {
|
|
2016
|
+
relatedQuery: true;
|
|
2017
|
+
outputType: infer OT extends TypeName<D>;
|
|
2018
|
+
} ? {
|
|
2019
|
+
relatedQuery?: RelatedQuery<D, OT>;
|
|
2020
|
+
} : unknown;
|
|
2021
|
+
/** The options an action takes beside its media and `wait` choices: `filter` and `relatedQuery`. */
|
|
2022
|
+
type ActionQueryOptions<D extends ApiDescriptor, Act> = ActionFilterOptions<Act> & ActionRelatedQueryOptions<D, Act>;
|
|
1925
2023
|
/** The raw response media types an action declares (`[]` when none). */
|
|
1926
2024
|
type RawOutputOf<Act> = Act extends {
|
|
1927
2025
|
rawOutput: infer R extends readonly RawOutputMedia[];
|
|
@@ -2022,34 +2120,37 @@ type WithInput<D extends ApiDescriptor, W, Act, E> = Act extends {
|
|
|
2022
2120
|
* The result is shaped by the action's `output` (see {@link ActionResult}). An action that answers
|
|
2023
2121
|
* in raw media types takes an `accept` naming one, and resolves to that media type's value. An
|
|
2024
2122
|
* action listing several request media types takes a `contentType` naming one, and its body is
|
|
2025
|
-
* typed by that media type. An action that takes filters takes a `filter` option keyed by them
|
|
2123
|
+
* typed by that media type. An action that takes filters takes a `filter` option keyed by them,
|
|
2124
|
+
* and one that takes `relatedQuery` takes it typed by its output type.
|
|
2026
2125
|
*/
|
|
2027
2126
|
type ActionMethod<D extends ApiDescriptor, A, W, Act extends ActionDescriptor, E> = Act extends {
|
|
2028
2127
|
inputMedia: readonly InputMedia[];
|
|
2029
2128
|
} ? <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?: {
|
|
2030
2129
|
signal?: AbortSignal;
|
|
2031
2130
|
contentType?: C;
|
|
2032
|
-
} & ResponseOptions<Act, M, RT> &
|
|
2131
|
+
} & ResponseOptions<Act, M, RT> & ActionQueryOptions<D, Act> & ActionWaitOption<Act>) => ActionResultIn<D, A, Act, E, M, RT> : Act extends {
|
|
2033
2132
|
rawOutput: readonly RawOutputMedia[];
|
|
2034
2133
|
} ? Act extends {
|
|
2035
2134
|
input: 'none';
|
|
2036
2135
|
} ? <const M extends AcceptOf<Act> = Extract<DefaultAccept<Act>, AcceptOf<Act>>, RT extends BinaryResponseType = 'blob'>(options?: {
|
|
2037
2136
|
signal?: AbortSignal;
|
|
2038
|
-
} & ResponseOptions<Act, M, RT> &
|
|
2137
|
+
} & 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?: {
|
|
2039
2138
|
signal?: AbortSignal;
|
|
2040
|
-
} & ResponseOptions<Act, M, RT> &
|
|
2139
|
+
} & ResponseOptions<Act, M, RT> & ActionQueryOptions<D, Act> & ActionWaitOption<Act>) => ActionResultIn<D, A, Act, E, M, RT> : Act extends {
|
|
2041
2140
|
accepted: object;
|
|
2042
2141
|
} ? AcceptedActionMethod<D, A, W, Act, E> : Act extends {
|
|
2043
2142
|
filterable: readonly string[];
|
|
2044
2143
|
} | {
|
|
2045
2144
|
filterFamilies: readonly unknown[];
|
|
2145
|
+
} | {
|
|
2146
|
+
relatedQuery: true;
|
|
2046
2147
|
} ? Act extends {
|
|
2047
2148
|
input: 'none';
|
|
2048
2149
|
} ? (options?: {
|
|
2049
2150
|
signal?: AbortSignal;
|
|
2050
|
-
} &
|
|
2151
|
+
} & ActionQueryOptions<D, Act>) => ActionResult<D, A, Act, E> : (input: WithInput<D, W, Act, E>, options?: {
|
|
2051
2152
|
signal?: AbortSignal;
|
|
2052
|
-
} &
|
|
2153
|
+
} & ActionQueryOptions<D, Act>) => ActionResult<D, A, Act, E> : Act extends {
|
|
2053
2154
|
input: 'none';
|
|
2054
2155
|
} ? () => ActionResult<D, A, Act, E> : (input: WithInput<D, W, Act, E>) => ActionResult<D, A, Act, E>;
|
|
2055
2156
|
/**
|
|
@@ -2061,19 +2162,19 @@ type AcceptedActionMethod<D extends ApiDescriptor, A, W, Act extends ActionDescr
|
|
|
2061
2162
|
} ? {
|
|
2062
2163
|
(options: {
|
|
2063
2164
|
signal?: AbortSignal;
|
|
2064
|
-
} &
|
|
2165
|
+
} & ActionQueryOptions<D, Act> & WaitOptions): Promise<ActionValue<D, A, Act, E>>;
|
|
2065
2166
|
(options?: {
|
|
2066
2167
|
signal?: AbortSignal;
|
|
2067
2168
|
wait?: false;
|
|
2068
|
-
} &
|
|
2169
|
+
} & ActionQueryOptions<D, Act>): ActionResult<D, A, Act, E>;
|
|
2069
2170
|
} : {
|
|
2070
2171
|
(input: WithInput<D, W, Act, E>, options: {
|
|
2071
2172
|
signal?: AbortSignal;
|
|
2072
|
-
} &
|
|
2173
|
+
} & ActionQueryOptions<D, Act> & WaitOptions): Promise<ActionValue<D, A, Act, E>>;
|
|
2073
2174
|
(input: WithInput<D, W, Act, E>, options?: {
|
|
2074
2175
|
signal?: AbortSignal;
|
|
2075
2176
|
wait?: false;
|
|
2076
|
-
} &
|
|
2177
|
+
} & ActionQueryOptions<D, Act>): ActionResult<D, A, Act, E>;
|
|
2077
2178
|
};
|
|
2078
2179
|
/**
|
|
2079
2180
|
* The typed map of a type's custom actions at one scope (`collection` on the
|
|
@@ -2094,7 +2195,7 @@ type ActionsAccessor<D extends ApiDescriptor, A, W, T extends TypeName<D>, Scope
|
|
|
2094
2195
|
type ResourceHandle<D extends ApiDescriptor, A, W, T extends TypeName<D>, Act = DefaultActionTypes> = {
|
|
2095
2196
|
readonly type: T;
|
|
2096
2197
|
readonly id: string;
|
|
2097
|
-
get<const Inc extends readonly IncludePath<D, T>[] = [], const F extends FieldsMap<D> = {}>(query?: SingleReadQuery<D, T, Inc, F>): Promise<ReadResult<D, A, T, Inc, F>>;
|
|
2198
|
+
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]>>;
|
|
2098
2199
|
update: UpdateMethod<D, A, W, T>;
|
|
2099
2200
|
delete(): Promise<void>;
|
|
2100
2201
|
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). */
|
|
@@ -2103,7 +2204,7 @@ type ResourceHandle<D extends ApiDescriptor, A, W, T extends TypeName<D>, Act =
|
|
|
2103
2204
|
/** The collection-scoped accessor for one wire type (`client.albums`). */
|
|
2104
2205
|
interface TypeAccessor<D extends ApiDescriptor, A, W, T extends TypeName<D>, Act = DefaultActionTypes> {
|
|
2105
2206
|
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>>>;
|
|
2106
|
-
get<const Inc extends readonly IncludePath<D, T>[] = [], const F extends FieldsMap<D> = {}>(id: string, query?: SingleReadQuery<D, T, Inc, F>): Promise<ReadResult<D, A, T, Inc, F>>;
|
|
2207
|
+
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]>>;
|
|
2107
2208
|
create: CreateMethod<D, A, W, T>;
|
|
2108
2209
|
id(id: string): ResourceHandle<D, A, W, T, Act>;
|
|
2109
2210
|
/** The type's collection-scoped custom actions, keyed by name. */
|
|
@@ -2272,8 +2373,8 @@ interface ReadQuery {
|
|
|
2272
2373
|
/** Relationship-count tokens (the Countable profile) — serialised comma-joined onto `withCount`. */
|
|
2273
2374
|
withCount?: readonly string[];
|
|
2274
2375
|
/**
|
|
2275
|
-
* A `filter` and `sort` per
|
|
2276
|
-
* `relatedQuery[<
|
|
2376
|
+
* A `filter` and `sort` per relation (the Relationship Queries profile), serialised as
|
|
2377
|
+
* `relatedQuery[<relation>][filter][<key>]` and `relatedQuery[<relation>][sort]`.
|
|
2277
2378
|
*/
|
|
2278
2379
|
relatedQuery?: Readonly<Record<string, {
|
|
2279
2380
|
filter?: Readonly<Record<string, unknown>>;
|
|
@@ -2321,9 +2422,9 @@ interface JsonApiRequest {
|
|
|
2321
2422
|
listFilter?: (key: string) => boolean;
|
|
2322
2423
|
/**
|
|
2323
2424
|
* The filter keys of a {@link ReadQuery.relatedQuery} entry that take a list, by the entry's
|
|
2324
|
-
*
|
|
2425
|
+
* relation. The client sets it from that relation's related-read vocabulary.
|
|
2325
2426
|
*/
|
|
2326
|
-
relatedListFilter?: (
|
|
2427
|
+
relatedListFilter?: (relation: string, key: string) => boolean;
|
|
2327
2428
|
body?: unknown;
|
|
2328
2429
|
/**
|
|
2329
2430
|
* Override the request `Content-Type`, which defaults to the negotiated JSON:API media type on
|
|
@@ -2364,10 +2465,10 @@ interface JsonApiRequest {
|
|
|
2364
2465
|
* (`filter[title]`, `page[number]`, `fields[albums]`) are kept literal; only values
|
|
2365
2466
|
* are percent-encoded. `isListFilter` names the filter keys that take a list, whose array value
|
|
2366
2467
|
* goes out as `filter[<key>][]` once per member, and `isRelatedListFilter` does the same for a
|
|
2367
|
-
* `relatedQuery` entry's filters by
|
|
2468
|
+
* `relatedQuery` entry's filters by relation. Empty/undefined entries are skipped; key order is deterministic
|
|
2368
2469
|
* (family order, then insertion order within a family) so URLs are stable for caching.
|
|
2369
2470
|
*/
|
|
2370
|
-
declare function serializeQuery(query: ReadQuery, isListFilter?: (key: string) => boolean, isRelatedListFilter?: (
|
|
2471
|
+
declare function serializeQuery(query: ReadQuery, isListFilter?: (key: string) => boolean, isRelatedListFilter?: (relation: string, key: string) => boolean): string;
|
|
2371
2472
|
/**
|
|
2372
2473
|
* Execute a request: build the URL (a server link resolved against `baseUrl` and held to its
|
|
2373
2474
|
* origin, an absolute path verbatim, else `baseUrl + path`), apply content negotiation and any async per-request headers,
|
|
@@ -2467,5 +2568,5 @@ declare function assertJsonApiDocument(body: unknown): asserts body is Document;
|
|
|
2467
2568
|
*/
|
|
2468
2569
|
declare function validateDocument(body: Document, validator: ResolvedValidator): void;
|
|
2469
2570
|
//#endregion
|
|
2470
|
-
export { IdentifierMember as $,
|
|
2471
|
-
//# sourceMappingURL=validate-
|
|
2571
|
+
export { IdentifierMember as $, ApiDescriptor as $n, AtomicHandle as $t, AcceptedOf as A, ExactPageParams as An, ResourceObjectView as At, CountedRelationName as B, resolvePaginator as Bn, UpdateMethod as Bt, createClient as C, RelationView as Cn, ResourceDescriptor as Cr, RelationPaginator as Ct, TransportResponse as D, relatedPaginator as Dn, isPolymorphic as Dr, ResourceAccessors as Dt, TransportRequest as E, materialise as En, StrategyDescriptor as Er, RelationshipAccessor as Et, BinaryResponseType as F, PageOf as Fn, TypeName as Ft, DefaultWriteAttributes as G, parseRetryAfter as Gn, WriteOptions as Gt, CreateMethod as H, PollOptions as Hn, WaitValue as Ht, Client as I, PageParams as In, TypedReadQuery as It, FieldSelectionMap as J, ActionDescriptor as Jn, isActionLocation as Jt, EdgeMembers as K, AcceptedDescriptor as Kn, WriteResult as Kt, Collection as L, PageParamsOf as Ln, TypedRelatedReadQuery as Lt, ActionsAccessor as M, PageKeys as Mn, SortQuery as Mt, AtomicResultOf as N, PageLinks as Nn, SortToken as Nt, fetchTransport as O, relatedPaginatorKind as On, ResourceCountToken as Ot, BinaryBody as P, PageMeta as Pn, TypeAccessor as Pt, HydratedMember as Q, ActionScope as Qn, AtomicDeleteHandle as Qt, CountAccessor as R, ResolvedPaginator as Rn, TypedRelationReadQuery as Rt, HeadersInit as S, RelationArrayEnvelope as Sn, ResourceCountOperation as Sr, RelationPageParams as St, TransportRawBody as T, ResourceLinks as Tn, SortFamilyDescriptor as Tr, RelationSortQuery as Tt, DefaultActionTypes as U, PollTimeoutError as Un, WaitedWriteResult as Ut, CreateInput as V, Accepted as Vn, WaitOptions as Vt, DefaultAttributes as W, isAccepted as Wn, WithLinks as Wt, FilterKey as X, ActionLocationDescriptor as Xn, AtomicCreateHandle as Xt, FieldsMap as Y, ActionInput as Yn, readActionLocation as Yt, FilterQuery as Z, ActionOutput as Zn, AtomicCreateInput as Zt, executeRaw as _, EdgeEnvelope as _n, RawOutputMedia as _r, RelatedQueryRelation as _t, Validator as a, AtomicUpdateInput as an, FilterFamilyDescriptor as ar, ListPageParams as at, ClientOptions as b, MaterialiseContext as bn, RelationDescriptor as br, RelationFilterQuery as bt, resolveValidator as c, ATOMIC_MEDIA_TYPE as cn, MediaExamples as cr, MemberName as ct, ExecutedResponse as d, MediaTypeParams as dn, PaginatorDescriptor as dr, ReadableRelationName as dt, AtomicRecorder as en, ApiExamples as er, IncludePath as et, JsonApiContext as f, ResourceIdentifier as fn, PaginatorKind as fr, RelatedIncludedResource as ft, execute as g, Edge as gn, RawMediaKind as gr, RelatedQueryParam as gt, ReadQuery as h, DocumentEnvelope as hn, PivotDescriptor as hr, RelatedQueryEntry as ht, ValidationOption as i, AtomicUpdateHandle as in, CountableDescriptor as ir, LinkageRef as it, ActionCallOptions as j, Page as jn, SingleReadQuery as jt, AcceptedJob as k, CANONICAL_PAGE_KEYS as kn, ResourceHandle as kt, validateDocument as l, JSON_API_MEDIA_TYPE as ln, MenuDescriptor as lr, PivotInput as lt, RawResponseType as m, ArrayEnvelope as mn, PaginatorStrategy as mr, RelatedQuery as mt, SchemaMap as n, AtomicResult as nn, Cardinality as nr, IncludedResource as nt, WireResource as o, runAtomic as on, InputMedia as or, LooseRelatedQuery as ot, JsonApiRequest as p, mediaType as pn, PaginatorRole as pr, RelatedIncludedType as pt, ErrorCodeOf as q, AcceptedOperation as qn, ActionLocation as qt, ValidationConfig as r, AtomicResults as rn, ClientIdPolicy as rr, IncludedType as rt, assertJsonApiDocument as s, ATOMIC_EXT as sn, InputMediaKind as sr, LooseRelatedQueryEntry as st, ResolvedValidator as t, AtomicRef as tn, AtomicDescriptor as tr, IncludedRelations as tt, Document as u, LocalIdentifier as un, OperationExamples as ur, ReadResult as ut, executeResponse as v, Link as vn, RelatedQueryDescriptor as vr, RelatedReadRelatedQuery as vt, JsonApiTransport as w, ResourceEnvelope as wn, ResourceExamples as wr, RelationReadQuery as wt, HANDLE_RESERVED as x, NavigateOptions as xn, RelationMutations as xr, RelationName as xt, serializeQuery as y, LinkObject as yn, RelatedQueryOperation as yr, RelationCollection as yt, CountToken as z, TypedPage as zn, UpdateInput as zt };
|
|
2572
|
+
//# sourceMappingURL=validate-Rgo7Zm0U.d.mts.map
|