@haddowg/json-api-client 1.21.0 → 1.23.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 +18 -4
- package/dist/ajv.d.cts +1 -1
- package/dist/ajv.d.mts +1 -1
- package/dist/index.cjs +117 -74
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +117 -74
- package/dist/index.mjs.map +1 -1
- package/dist/{validate-DGoH9XA9.d.cts → validate-Cs7iAT9y.d.cts} +174 -66
- package/dist/validate-Cs7iAT9y.d.cts.map +1 -0
- package/dist/{validate-DGoH9XA9.d.mts → validate-Cs7iAT9y.d.mts} +174 -66
- package/dist/validate-Cs7iAT9y.d.mts.map +1 -0
- package/package.json +1 -1
- package/dist/validate-DGoH9XA9.d.cts.map +0 -1
- package/dist/validate-DGoH9XA9.d.mts.map +0 -1
package/README.md
CHANGED
|
@@ -108,6 +108,18 @@ tracks.$page.kind
|
|
|
108
108
|
const linkage = await client.albums.id('1').rel('tracks').get()
|
|
109
109
|
```
|
|
110
110
|
|
|
111
|
+
### A singleton
|
|
112
|
+
|
|
113
|
+
A singleton type serves each caller one resource at a path with no id (`/inbox`). Its accessor is
|
|
114
|
+
a handle on that resource, with no `list`, `create`, `id()` or `delete`. The update body needs the
|
|
115
|
+
resource's id, so the input carries it:
|
|
116
|
+
|
|
117
|
+
```ts
|
|
118
|
+
const inbox = await client.inboxes.get() // GET /inbox
|
|
119
|
+
await client.inboxes.update({ id: inbox.id, seenUpTo: new Date().toISOString() }) // PATCH /inbox
|
|
120
|
+
const owner = await client.inboxes.owner.related() // GET /inbox/owner
|
|
121
|
+
```
|
|
122
|
+
|
|
111
123
|
### Pivot data on a many-to-many edge
|
|
112
124
|
|
|
113
125
|
Each member of a `belongsToMany` to-many carries its per-edge pivot under `$pivot` (typed sugar
|
|
@@ -136,10 +148,12 @@ the same value as `$count`. Both are `undefined` when the server sent no finite
|
|
|
136
148
|
|
|
137
149
|
### `relatedQuery` (the Relationship Queries profile)
|
|
138
150
|
|
|
139
|
-
Where
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
151
|
+
Where the server documents it, `relatedQuery` filters and sorts a relationship of the resources
|
|
152
|
+
an operation answers with: `list`, `get`, `create`, `update`, the `.related()` read of a relation
|
|
153
|
+
over one type, and an action answering with a resource. It's keyed by relation name, and each
|
|
154
|
+
entry's `filter` and `sort` take what the relation's own related read takes, with no `sort` on a
|
|
155
|
+
to-one. The client negotiates the profile in `Accept`, beside the Countable one when `withCount`
|
|
156
|
+
is set too.
|
|
143
157
|
|
|
144
158
|
```ts
|
|
145
159
|
const runs = await client['campaign-template-runs'].list({
|
package/dist/ajv.d.cts
CHANGED
package/dist/ajv.d.mts
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -184,7 +184,7 @@ const appendFilterValue = (parts, key, value, list = false) => {
|
|
|
184
184
|
* (`filter[title]`, `page[number]`, `fields[albums]`) are kept literal; only values
|
|
185
185
|
* are percent-encoded. `isListFilter` names the filter keys that take a list, whose array value
|
|
186
186
|
* goes out as `filter[<key>][]` once per member, and `isRelatedListFilter` does the same for a
|
|
187
|
-
* `relatedQuery` entry's filters by
|
|
187
|
+
* `relatedQuery` entry's filters by relation. Empty/undefined entries are skipped; key order is deterministic
|
|
188
188
|
* (family order, then insertion order within a family) so URLs are stable for caching.
|
|
189
189
|
*/
|
|
190
190
|
function serializeQuery(query, isListFilter, isRelatedListFilter) {
|
|
@@ -194,9 +194,9 @@ function serializeQuery(query, isListFilter, isRelatedListFilter) {
|
|
|
194
194
|
if (query.include) append(parts, "include", query.include.join(","));
|
|
195
195
|
if (query.fields) for (const [type, names] of Object.entries(query.fields)) parts.push(`fields[${type}]=${encodeURIComponent(names.join(","))}`);
|
|
196
196
|
if (query.withCount && query.withCount.length > 0) append(parts, "withCount", query.withCount.join(","));
|
|
197
|
-
for (const [
|
|
198
|
-
for (const [key, value] of Object.entries(entry?.filter ?? {})) appendFilterValue(parts, `relatedQuery[${
|
|
199
|
-
if (entry?.sort !== void 0) append(parts, `relatedQuery[${
|
|
197
|
+
for (const [relation, entry] of Object.entries(query.relatedQuery ?? {})) {
|
|
198
|
+
for (const [key, value] of Object.entries(entry?.filter ?? {})) appendFilterValue(parts, `relatedQuery[${relation}][filter][${key}]`, value, isRelatedListFilter?.(relation, key) ?? false);
|
|
199
|
+
if (entry?.sort !== void 0) append(parts, `relatedQuery[${relation}][sort]`, typeof entry.sort === "string" ? entry.sort : entry.sort.join(","));
|
|
200
200
|
}
|
|
201
201
|
if (query.page) for (const [key, value] of Object.entries(query.page)) append(parts, `page[${key}]`, Array.isArray(value) ? value.join(",") : value);
|
|
202
202
|
return parts.join("&");
|
|
@@ -1199,6 +1199,15 @@ function parseResults(doc, ctx) {
|
|
|
1199
1199
|
});
|
|
1200
1200
|
}
|
|
1201
1201
|
//#endregion
|
|
1202
|
+
//#region src/descriptor.ts
|
|
1203
|
+
/**
|
|
1204
|
+
* Whether a relation is polymorphic: flagged {@link RelationDescriptor.polymorphic}, or, when the
|
|
1205
|
+
* flag is absent, listing more than one related type.
|
|
1206
|
+
*/
|
|
1207
|
+
function isPolymorphic(relation) {
|
|
1208
|
+
return relation.polymorphic ?? relation.types.length > 1;
|
|
1209
|
+
}
|
|
1210
|
+
//#endregion
|
|
1202
1211
|
//#region src/filters.ts
|
|
1203
1212
|
/**
|
|
1204
1213
|
* Whether a `filter[...]` key takes a list, by the rule the server matches keys with: an exact
|
|
@@ -1333,9 +1342,9 @@ async function run(ctx, type, operation, vars, query, linkage = false, relationF
|
|
|
1333
1342
|
req.query = params;
|
|
1334
1343
|
const listFilter = listFilterMatcher(filterSpec(ctx, type, operation, vars["rel"]));
|
|
1335
1344
|
if (listFilter !== void 0) req.listFilter = listFilter;
|
|
1336
|
-
if (params.relatedQuery !== void 0) req.relatedListFilter = relatedListFilter(ctx, type);
|
|
1337
1345
|
if (signal !== void 0) req.signal = signal;
|
|
1338
1346
|
negotiateProfiles(ctx, type, params, req, relationForCount, operation);
|
|
1347
|
+
applyRelatedQuery(ctx, renderedType(ctx, type, operation, vars["rel"]), params, req);
|
|
1339
1348
|
}
|
|
1340
1349
|
const doc = await execute(ctx.request, req);
|
|
1341
1350
|
const relation = (operation === "fetchRelated" || operation === "fetchRelationship") && vars["rel"] !== void 0 ? ctx.descriptor[type]?.relations[vars["rel"]] : void 0;
|
|
@@ -1357,40 +1366,41 @@ function filterSpec(ctx, type, operation, rel) {
|
|
|
1357
1366
|
return types?.length === 1 ? ctx.descriptor[types[0]] : void 0;
|
|
1358
1367
|
}
|
|
1359
1368
|
/**
|
|
1360
|
-
*
|
|
1361
|
-
*
|
|
1362
|
-
*
|
|
1369
|
+
* The type whose resources an operation answers with, which keys its `relatedQuery`: the type
|
|
1370
|
+
* itself, or a related read's related type when the relation is monomorphic. A relationship read
|
|
1371
|
+
* answers with linkage, so it has none.
|
|
1363
1372
|
*/
|
|
1364
|
-
function
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
};
|
|
1370
|
-
}
|
|
1371
|
-
/** The filter vocabulary of the relation an include path from `type` ends on. */
|
|
1372
|
-
function relatedQuerySpec(ctx, type, path) {
|
|
1373
|
-
const names = path.split(".");
|
|
1374
|
-
let owners = [type];
|
|
1375
|
-
for (const [index, name] of names.entries()) {
|
|
1376
|
-
const owner = owners.find((t) => ctx.descriptor[t]?.relations[name] !== void 0);
|
|
1377
|
-
if (owner === void 0) return;
|
|
1378
|
-
if (index === names.length - 1) return filterSpec(ctx, owner, "fetchRelated", name);
|
|
1379
|
-
owners = ctx.descriptor[owner].relations[name].types;
|
|
1380
|
-
}
|
|
1373
|
+
function renderedType(ctx, type, operation, rel) {
|
|
1374
|
+
if (operation === "fetchRelationship") return;
|
|
1375
|
+
if (operation !== "fetchRelated") return type;
|
|
1376
|
+
const relation = rel === void 0 ? void 0 : ctx.descriptor[type]?.relations[rel];
|
|
1377
|
+
return relation === void 0 || isPolymorphic(relation) ? void 0 : relation.types[0];
|
|
1381
1378
|
}
|
|
1382
|
-
/** Whether a `relatedQuery` carries a filter or sort for any
|
|
1379
|
+
/** Whether a `relatedQuery` carries a filter or sort for any relation, so it reaches the wire. */
|
|
1383
1380
|
function sendsRelatedQuery(relatedQuery) {
|
|
1384
1381
|
return Object.values(relatedQuery ?? {}).some((entry) => Object.keys(entry?.filter ?? {}).length > 0 || entry?.sort !== void 0 && entry.sort.length > 0);
|
|
1385
1382
|
}
|
|
1386
1383
|
/**
|
|
1387
|
-
*
|
|
1388
|
-
*
|
|
1389
|
-
*
|
|
1384
|
+
* Prepare a request's `relatedQuery` for resources of type `rendered`: match each entry's list
|
|
1385
|
+
* filters against its relation's related-read vocabulary, and negotiate the type's Relationship
|
|
1386
|
+
* Queries profile, after any Countable one, when the query sends an entry.
|
|
1387
|
+
*/
|
|
1388
|
+
function applyRelatedQuery(ctx, rendered, query, req) {
|
|
1389
|
+
if (rendered === void 0 || !sendsRelatedQuery(query.relatedQuery)) return;
|
|
1390
|
+
const matchers = /* @__PURE__ */ new Map();
|
|
1391
|
+
req.relatedListFilter = (rel, key) => {
|
|
1392
|
+
if (!matchers.has(rel)) matchers.set(rel, listFilterMatcher(filterSpec(ctx, rendered, "fetchRelated", rel)));
|
|
1393
|
+
return matchers.get(rel)?.(key) ?? false;
|
|
1394
|
+
};
|
|
1395
|
+
const profile = ctx.descriptor[rendered]?.relatedQuery?.profile;
|
|
1396
|
+
if (profile !== void 0 && !(req.profiles ?? []).includes(profile)) req.profiles = [...req.profiles ?? [], profile];
|
|
1397
|
+
}
|
|
1398
|
+
/**
|
|
1399
|
+
* Add the Countable profile a query's `withCount` requires to the request's negotiated
|
|
1400
|
+
* `profiles`. A `withCount` read or write needs it in `Accept`, else the server rejects it (400)
|
|
1401
|
+
* under strict query-param validation. The profile URI is read from the descriptor (never
|
|
1390
1402
|
* hardcoded): the relation's `countable` for a related or relationship read, the operation's
|
|
1391
1403
|
* `resourceCountable` entry for a single-resource read or a write, else the type's `countable`.
|
|
1392
|
-
* A `relatedQuery` on a collection or single read likewise adds the type's Relationship Queries
|
|
1393
|
-
* profile, after any Countable one.
|
|
1394
1404
|
*/
|
|
1395
1405
|
function negotiateProfiles(ctx, type, query, req, relationForCount, operation) {
|
|
1396
1406
|
const profiles = [];
|
|
@@ -1399,10 +1409,6 @@ function negotiateProfiles(ctx, type, query, req, relationForCount, operation) {
|
|
|
1399
1409
|
const profile = relationForCount !== void 0 ? descriptor?.relations[relationForCount]?.countable?.profile : (isResourceCountOperation(operation) ? descriptor?.resourceCountable?.[operation]?.profile : void 0) ?? descriptor?.countable?.profile;
|
|
1400
1410
|
if (profile !== void 0) profiles.push(profile);
|
|
1401
1411
|
}
|
|
1402
|
-
if (relationForCount === void 0 && sendsRelatedQuery(query.relatedQuery)) {
|
|
1403
|
-
const profile = ctx.descriptor[type]?.relatedQuery?.profile;
|
|
1404
|
-
if (profile !== void 0 && !profiles.includes(profile)) profiles.push(profile);
|
|
1405
|
-
}
|
|
1406
1412
|
if (profiles.length > 0) req.profiles = [...req.profiles ?? [], ...profiles];
|
|
1407
1413
|
}
|
|
1408
1414
|
/** Whether an operation is one answering with one resource that may take `withCount`. */
|
|
@@ -1410,14 +1416,15 @@ function isResourceCountOperation(operation) {
|
|
|
1410
1416
|
return operation === "fetchOne" || operation === "create" || operation === "update";
|
|
1411
1417
|
}
|
|
1412
1418
|
/**
|
|
1413
|
-
* Project a write's opts to the read-query families the response honours: `include`, `fields
|
|
1414
|
-
* and `
|
|
1419
|
+
* Project a write's opts to the read-query families the response honours: `include`, `fields`,
|
|
1420
|
+
* `withCount` and `relatedQuery`.
|
|
1415
1421
|
*/
|
|
1416
1422
|
function writeQuery(opts) {
|
|
1417
1423
|
if (opts === void 0) return;
|
|
1418
1424
|
const query = {};
|
|
1419
1425
|
if (opts.include !== void 0) query.include = [...opts.include];
|
|
1420
1426
|
if (opts.withCount !== void 0) query.withCount = [...opts.withCount];
|
|
1427
|
+
if (opts.relatedQuery !== void 0) query.relatedQuery = opts.relatedQuery;
|
|
1421
1428
|
if (opts.fields !== void 0) {
|
|
1422
1429
|
const fields = {};
|
|
1423
1430
|
for (const [k, v] of Object.entries(opts.fields)) fields[k] = [...v];
|
|
@@ -1460,6 +1467,7 @@ async function runWrite(ctx, spec) {
|
|
|
1460
1467
|
if (spec.query !== void 0) {
|
|
1461
1468
|
req.query = spec.query;
|
|
1462
1469
|
negotiateProfiles(ctx, spec.type, spec.query, req, void 0, spec.operation);
|
|
1470
|
+
applyRelatedQuery(ctx, spec.type, spec.query, req);
|
|
1463
1471
|
if (req.profiles !== void 0) req.contentType = JSON_API_MEDIA_TYPE;
|
|
1464
1472
|
}
|
|
1465
1473
|
if (spec.wait?.signal !== void 0) req.signal = spec.wait.signal;
|
|
@@ -1495,7 +1503,8 @@ async function runWrite(ctx, spec) {
|
|
|
1495
1503
|
* `ActionLocation` and never follows it. An action declaring `rawOutput` answers in the media type
|
|
1496
1504
|
* the caller picks with `options.accept`: JSON:API as above, or a `string`, a `Blob` or
|
|
1497
1505
|
* `ArrayBuffer`, or parsed JSON by the media type's kind. A collection action that takes filters
|
|
1498
|
-
* sends `options.filter` in the query string as a collection read does
|
|
1506
|
+
* sends `options.filter` in the query string as a collection read does, and an action answering
|
|
1507
|
+
* with a resource sends `options.relatedQuery` as a read does. A `202` the action
|
|
1499
1508
|
* declares resolves to an `Accepted` job, or with `options.wait` to the value its job URL ends at.
|
|
1500
1509
|
*/
|
|
1501
1510
|
async function runAction(ctx, action, vars, input, options = {}) {
|
|
@@ -1509,6 +1518,13 @@ async function runAction(ctx, action, vars, input, options = {}) {
|
|
|
1509
1518
|
const listFilter = listFilterMatcher(action);
|
|
1510
1519
|
if (listFilter !== void 0) req.listFilter = listFilter;
|
|
1511
1520
|
}
|
|
1521
|
+
if (options.relatedQuery !== void 0) {
|
|
1522
|
+
req.query = {
|
|
1523
|
+
...req.query,
|
|
1524
|
+
relatedQuery: options.relatedQuery
|
|
1525
|
+
};
|
|
1526
|
+
applyRelatedQuery(ctx, action.outputType, req.query, req);
|
|
1527
|
+
}
|
|
1512
1528
|
let remap;
|
|
1513
1529
|
const media = requestMedia(action, options.contentType);
|
|
1514
1530
|
if (media !== void 0 && media.kind !== "document") {
|
|
@@ -1525,6 +1541,7 @@ async function runAction(ctx, action, vars, input, options = {}) {
|
|
|
1525
1541
|
req.contentType = sentContentType(action.contentType ?? "*/*", void 0, req.body);
|
|
1526
1542
|
req.raw = true;
|
|
1527
1543
|
}
|
|
1544
|
+
if (req.profiles !== void 0 && req.contentType === void 0) req.contentType = JSON_API_MEDIA_TYPE;
|
|
1528
1545
|
const raw = responseMedia(action, options.accept);
|
|
1529
1546
|
try {
|
|
1530
1547
|
if (raw !== void 0) {
|
|
@@ -1666,16 +1683,17 @@ function actionsAccessor(ctx, type, scope, vars) {
|
|
|
1666
1683
|
return out;
|
|
1667
1684
|
}
|
|
1668
1685
|
/**
|
|
1669
|
-
* Build the relationship accessor for `client.<type>.id(id).<rel
|
|
1686
|
+
* Build the relationship accessor for `client.<type>.id(id).<rel>`, or a singleton's
|
|
1687
|
+
* `client.<type>.<rel>` with no `id` in `vars`: reads
|
|
1670
1688
|
* (`.get()` linkage / `.related()` collection) plus mutations — to-many `.add` (POST) /
|
|
1671
1689
|
* `.remove` (DELETE) / `.replace` (PATCH) and to-one `.set` (PATCH). Every mutation posts
|
|
1672
1690
|
* a `{ data: <linkage> }` body to `fetchRelationship` and materialises the response as
|
|
1673
1691
|
* linkage (or `undefined`/`void` for a `204`). The cardinality is read off the descriptor
|
|
1674
1692
|
* so the linkage is coerced correctly; the static types gate which verb is callable.
|
|
1675
1693
|
*/
|
|
1676
|
-
function relationshipAccessor(ctx, type,
|
|
1694
|
+
function relationshipAccessor(ctx, type, owner, rel) {
|
|
1677
1695
|
const vars = {
|
|
1678
|
-
|
|
1696
|
+
...owner,
|
|
1679
1697
|
rel
|
|
1680
1698
|
};
|
|
1681
1699
|
const relation = ctx.descriptor[type]?.relations[rel];
|
|
@@ -1721,39 +1739,72 @@ const HANDLE_RESERVED = /* @__PURE__ */ new Set([
|
|
|
1721
1739
|
"actions",
|
|
1722
1740
|
"then"
|
|
1723
1741
|
]);
|
|
1742
|
+
/**
|
|
1743
|
+
* Run a type's update. `vars` fill its path (`{ id }`, or nothing for a singleton) and `id` is
|
|
1744
|
+
* the one the body carries.
|
|
1745
|
+
*/
|
|
1746
|
+
function runUpdate(ctx, type, vars, id, patch, opts) {
|
|
1747
|
+
return runWrite(ctx, {
|
|
1748
|
+
type,
|
|
1749
|
+
operation: "update",
|
|
1750
|
+
vars,
|
|
1751
|
+
method: "PATCH",
|
|
1752
|
+
body: toDocument(ctx.descriptor, type, patch, { id }),
|
|
1753
|
+
query: writeQuery(opts),
|
|
1754
|
+
remap: (error) => withRemappedPaths(error, ctx.descriptor, type),
|
|
1755
|
+
accepted: ctx.descriptor[type]?.accepted?.update,
|
|
1756
|
+
wait: waitOptions(opts?.wait)
|
|
1757
|
+
});
|
|
1758
|
+
}
|
|
1759
|
+
/**
|
|
1760
|
+
* Wrap a handle's verbs in a Proxy resolving each relation not shadowed by a reserved member to
|
|
1761
|
+
* its relationship accessor, addressed by `vars`.
|
|
1762
|
+
*/
|
|
1763
|
+
function withRelations(ctx, type, vars, base) {
|
|
1764
|
+
const relations = ctx.descriptor[type]?.relations ?? {};
|
|
1765
|
+
return new Proxy(base, { get(target, prop, receiver) {
|
|
1766
|
+
if (typeof prop === "string" && !HANDLE_RESERVED.has(prop) && prop in relations) return relationshipAccessor(ctx, type, vars, prop);
|
|
1767
|
+
return Reflect.get(target, prop, receiver);
|
|
1768
|
+
} });
|
|
1769
|
+
}
|
|
1724
1770
|
/** Build the id-scoped resource handle (a Proxy resolving relation accessors by name). */
|
|
1725
1771
|
function resourceHandle(ctx, type, id) {
|
|
1726
|
-
const
|
|
1727
|
-
|
|
1772
|
+
const vars = { id };
|
|
1773
|
+
return withRelations(ctx, type, vars, {
|
|
1728
1774
|
type,
|
|
1729
1775
|
id,
|
|
1730
|
-
get: (query) => run(ctx, type, "fetchOne",
|
|
1731
|
-
update: (patch, opts) =>
|
|
1732
|
-
type,
|
|
1733
|
-
operation: "update",
|
|
1734
|
-
vars: { id },
|
|
1735
|
-
method: "PATCH",
|
|
1736
|
-
body: toDocument(ctx.descriptor, type, patch, { id }),
|
|
1737
|
-
query: writeQuery(opts),
|
|
1738
|
-
remap: (error) => withRemappedPaths(error, ctx.descriptor, type),
|
|
1739
|
-
accepted: ctx.descriptor[type]?.accepted?.update,
|
|
1740
|
-
wait: waitOptions(opts?.wait)
|
|
1741
|
-
}),
|
|
1776
|
+
get: (query) => run(ctx, type, "fetchOne", vars, query),
|
|
1777
|
+
update: (patch, opts) => runUpdate(ctx, type, vars, id, patch, opts),
|
|
1742
1778
|
delete: () => runWrite(ctx, {
|
|
1743
1779
|
type,
|
|
1744
1780
|
operation: "delete",
|
|
1745
|
-
vars
|
|
1781
|
+
vars,
|
|
1746
1782
|
method: "DELETE",
|
|
1747
1783
|
body: void 0,
|
|
1748
1784
|
remap: (error) => withRemappedPaths(error, ctx.descriptor, type)
|
|
1749
1785
|
}),
|
|
1750
|
-
rel: (name) => relationshipAccessor(ctx, type,
|
|
1751
|
-
actions: actionsAccessor(ctx, type, "resource",
|
|
1752
|
-
};
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1786
|
+
rel: (name) => relationshipAccessor(ctx, type, vars, name),
|
|
1787
|
+
actions: actionsAccessor(ctx, type, "resource", vars)
|
|
1788
|
+
});
|
|
1789
|
+
}
|
|
1790
|
+
/**
|
|
1791
|
+
* Build the accessor of a singleton type (`client.inboxes`): a handle on the caller's one
|
|
1792
|
+
* resource, whose paths carry no id. Its update takes the resource's `id` in the input, since
|
|
1793
|
+
* the server reads it from the body.
|
|
1794
|
+
*/
|
|
1795
|
+
function singletonAccessor(ctx, type) {
|
|
1796
|
+
const vars = {};
|
|
1797
|
+
return withRelations(ctx, type, vars, {
|
|
1798
|
+
type,
|
|
1799
|
+
get: (query) => run(ctx, type, "fetchOne", vars, query),
|
|
1800
|
+
update: (input, opts) => {
|
|
1801
|
+
const { id, ...patch } = input;
|
|
1802
|
+
if (typeof id !== "string" || id === "") return Promise.reject(/* @__PURE__ */ new Error(`Updating the "${type}" singleton needs its id in the input, such as the id of the resource its get() read.`));
|
|
1803
|
+
return runUpdate(ctx, type, vars, id, patch, opts);
|
|
1804
|
+
},
|
|
1805
|
+
rel: (name) => relationshipAccessor(ctx, type, vars, name),
|
|
1806
|
+
actions: actionsAccessor(ctx, type, "resource", vars)
|
|
1807
|
+
});
|
|
1757
1808
|
}
|
|
1758
1809
|
/** Build the collection-scoped accessor for one wire type (`client.albums`). */
|
|
1759
1810
|
function typeAccessor(ctx, type) {
|
|
@@ -1777,7 +1828,8 @@ function typeAccessor(ctx, type) {
|
|
|
1777
1828
|
}
|
|
1778
1829
|
/**
|
|
1779
1830
|
* Build a descriptor-driven read client. Generic at runtime (a Proxy over the descriptor),
|
|
1780
|
-
* not per-type codegen: `client.<type>` yields a {@link TypeAccessor},
|
|
1831
|
+
* not per-type codegen: `client.<type>` yields a {@link TypeAccessor}, or a
|
|
1832
|
+
* {@link SingletonAccessor} for a singleton type, `.id(id)` a handle,
|
|
1781
1833
|
* and a handle's relation accessors drive the relationship/related endpoints. Navigation
|
|
1782
1834
|
* (`$next()`/`$prev()`, related links) is wired through `materialise`'s `navigate` seam,
|
|
1783
1835
|
* which resolves the server's link against `baseUrl`, executes it and re-materialises.
|
|
@@ -1819,7 +1871,7 @@ function createClient(descriptor, options) {
|
|
|
1819
1871
|
if (typeof prop !== "string" || !(prop in descriptor)) return;
|
|
1820
1872
|
let accessor = accessors.get(prop);
|
|
1821
1873
|
if (accessor === void 0) {
|
|
1822
|
-
accessor = typeAccessor(ctx, prop);
|
|
1874
|
+
accessor = descriptor[prop]?.singleton === true ? singletonAccessor(ctx, prop) : typeAccessor(ctx, prop);
|
|
1823
1875
|
accessors.set(prop, accessor);
|
|
1824
1876
|
}
|
|
1825
1877
|
return accessor;
|
|
@@ -1830,15 +1882,6 @@ function createClient(descriptor, options) {
|
|
|
1830
1882
|
});
|
|
1831
1883
|
}
|
|
1832
1884
|
//#endregion
|
|
1833
|
-
//#region src/descriptor.ts
|
|
1834
|
-
/**
|
|
1835
|
-
* Whether a relation is polymorphic: flagged {@link RelationDescriptor.polymorphic}, or, when the
|
|
1836
|
-
* flag is absent, listing more than one related type.
|
|
1837
|
-
*/
|
|
1838
|
-
function isPolymorphic(relation) {
|
|
1839
|
-
return relation.polymorphic ?? relation.types.length > 1;
|
|
1840
|
-
}
|
|
1841
|
-
//#endregion
|
|
1842
1885
|
exports.ATOMIC_EXT = ATOMIC_EXT;
|
|
1843
1886
|
exports.ATOMIC_MEDIA_TYPE = ATOMIC_MEDIA_TYPE;
|
|
1844
1887
|
exports.CANONICAL_PAGE_KEYS = CANONICAL_PAGE_KEYS;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as IdentifierMember, $n as
|
|
1
|
+
import { $ as IdentifierMember, $n as ActionLocationDescriptor, $t as AtomicCreateHandle, A as AcceptedOf, An as relatedPaginator, Ar as isPolymorphic, At as ResourceHandle, B as CountedRelationName, Bn as PageParamsOf, Bt as TypedRelatedReadQuery, C as createClient, Cn as MaterialiseContext, Cr as RelationDescriptor, Ct as RelationPageParams, D as TransportResponse, Dn as ResourceEnvelope, Dr as ResourceExamples, Dt as RelationshipAccessor, E as TransportRequest, En as RelationView, Er as ResourceDescriptor, Et as RelationSortQuery, F as BinaryResponseType, Fn as PageKeys, Ft as SortQuery, G as DefaultWriteAttributes, Gn as PollOptions, Gt as WaitValue, H as CreateMethod, Hn as TypedPage, Ht as UpdateInput, I as Client, In as PageLinks, It as SortToken, J as FieldSelectionMap, Jn as parseRetryAfter, Jt as WriteOptions, K as EdgeMembers, Kn as PollTimeoutError, Kt as WaitedWriteResult, L as Collection, Ln as PageMeta, Lt as TypeAccessor, M as ActionsAccessor, Mn as CANONICAL_PAGE_KEYS, Mt as SingleReadQuery, N as AtomicResultOf, Nn as ExactPageParams, Nt as SingletonAccessor, O as fetchTransport, On as ResourceLinks, Or as SortFamilyDescriptor, Ot as ResourceAccessors, P as BinaryBody, Pn as Page, Pt as SingletonUpdateInput, Q as HydratedMember, Qn as ActionInput, Qt as readActionLocation, R as CountAccessor, Rn as PageOf, Rt as TypeName, S as HeadersInit, Sn as LinkObject, Sr as RelatedQueryOperation, St as RelationName, T as TransportRawBody, Tn as RelationArrayEnvelope, Tr as ResourceCountOperation, Tt as RelationReadQuery, U as DefaultActionTypes, Un as resolvePaginator, Ut as UpdateMethod, V as CreateInput, Vn as ResolvedPaginator, Vt as TypedRelationReadQuery, W as DefaultAttributes, Wn as Accepted, Wt as WaitOptions, X as FilterKey, Xn as AcceptedOperation, Xt as ActionLocation, Y as FieldsMap, Yn as AcceptedDescriptor, Yt as WriteResult, Z as FilterQuery, Zn as ActionDescriptor, Zt as isActionLocation, _ as executeRaw, _n as ArrayEnvelope, _r as PaginatorStrategy, _t as RelatedQueryParam, a as Validator, an as AtomicResult, ar as Cardinality, at as LinkageRef, b as ClientOptions, bn as EdgeEnvelope, br as RawOutputMedia, bt as RelationCollection, c as resolveValidator, cn as AtomicUpdateInput, cr as FilterFamilyDescriptor, ct as LooseRelatedQueryEntry, d as ExecutedResponse, dn as ATOMIC_MEDIA_TYPE, dr as MediaExamples, dt as ReadResult, en as AtomicCreateInput, er as ActionOutput, et as IncludePath, f as JsonApiContext, fn as JSON_API_MEDIA_TYPE, fr as MenuDescriptor, ft as ReadableRelationName, g as execute, gn as mediaType, gr as PaginatorRole, gt as RelatedQueryEntry, h as ReadQuery, hn as ResourceIdentifier, hr as PaginatorKind, ht as RelatedQuery, i as ValidationOption, in as AtomicRef, ir as AtomicDescriptor, it as IsSingleton, j as ActionCallOptions, jn as relatedPaginatorKind, jt as ResourceObjectView, k as AcceptedJob, kn as materialise, kr as StrategyDescriptor, kt as ResourceCountToken, l as validateDocument, ln as runAtomic, lr as InputMedia, lt as MemberName, m as RawResponseType, mn as MediaTypeParams, mr as PaginatorDescriptor, mt as RelatedIncludedType, n as SchemaMap, nn as AtomicHandle, nr as ApiDescriptor, nt as IncludedResource, o as WireResource, on as AtomicResults, or as ClientIdPolicy, ot as ListPageParams, p as JsonApiRequest, pn as LocalIdentifier, pr as OperationExamples, pt as RelatedIncludedResource, q as ErrorCodeOf, qn as isAccepted, qt as WithLinks, r as ValidationConfig, rn as AtomicRecorder, rr as ApiExamples, rt as IncludedType, s as assertJsonApiDocument, sn as AtomicUpdateHandle, sr as CountableDescriptor, st as LooseRelatedQuery, t as ResolvedValidator, tn as AtomicDeleteHandle, tr as ActionScope, tt as IncludedRelations, u as Document, un as ATOMIC_EXT, ur as InputMediaKind, ut as PivotInput, v as executeResponse, vn as DocumentEnvelope, vr as PivotDescriptor, vt as RelatedQueryRelation, w as JsonApiTransport, wn as NavigateOptions, wr as RelationMutations, wt as RelationPaginator, x as HANDLE_RESERVED, xn as Link, xr as RelatedQueryDescriptor, xt as RelationFilterQuery, y as serializeQuery, yn as Edge, yr as RawMediaKind, yt as RelatedReadRelatedQuery, z as CountToken, zn as PageParams, zt as TypedReadQuery } from "./validate-Cs7iAT9y.cjs";
|
|
2
2
|
|
|
3
3
|
//#region src/errors.d.ts
|
|
4
4
|
/**
|
|
@@ -253,5 +253,5 @@ declare function withRemappedRelationshipPaths(error: JsonApiError, rel: string,
|
|
|
253
253
|
*/
|
|
254
254
|
declare function withRemappedAtomicPaths(error: JsonApiError, descriptor: ApiDescriptor, typeForOp: (opIndex: number) => string | undefined): JsonApiError;
|
|
255
255
|
//#endregion
|
|
256
|
-
export { ATOMIC_EXT, ATOMIC_MEDIA_TYPE, type Accepted, AcceptedDescriptor, AcceptedJob, AcceptedOf, AcceptedOperation, ActionCallOptions, ActionDescriptor, ActionInput, ActionLocation, ActionLocationDescriptor, ActionOutput, ActionScope, ActionsAccessor, ApiDescriptor, ApiExamples, ArrayEnvelope, AtomicCreateHandle, AtomicCreateInput, AtomicDeleteHandle, AtomicDescriptor, AtomicHandle, AtomicRecorder, AtomicRef, AtomicResult, AtomicResultOf, AtomicResults, AtomicUpdateHandle, AtomicUpdateInput, BinaryBody, BinaryResponseType, CANONICAL_PAGE_KEYS, Cardinality, Client, ClientIdPolicy, ClientOptions, CodedErrorObject, Collection, CountAccessor, CountToken, CountableDescriptor, CountedRelationName, CreateInput, CreateMethod, DefaultActionTypes, DefaultAttributes, DefaultWriteAttributes, Document, DocumentEnvelope, Edge, EdgeEnvelope, EdgeMembers, ErrorCodeGuard, ErrorCodeOf, ErrorFinder, ExactPageParams, ExecutedResponse, FieldSelectionMap, FieldsMap, FilterFamilyDescriptor, FilterKey, FilterQuery, FilterSpec, HANDLE_RESERVED, HeadersInit, HydratedMember, IdentifierMember, IncludePath, IncludedRelations, IncludedResource, IncludedType, InputMedia, InputMediaKind, JSON_API_MEDIA_TYPE, JsonApiContext, JsonApiError, JsonApiErrorObject, JsonApiRequest, JsonApiTransport, Link, LinkObject, LinkageRef, ListPageParams, LocalIdentifier, LooseRelatedQueryEntry, MaterialiseContext, MediaExamples, MediaTypeParams, MemberName, MenuDescriptor, NavigateOptions, OperationExamples, Page, PageKeys, PageLinks, PageMeta, PageOf, PageParams, PageParamsOf, PaginatorDescriptor, PaginatorKind, PaginatorRole, PaginatorStrategy, PivotDescriptor, PivotInput, type PollOptions, PollTimeoutError, RawMediaKind, RawOutputMedia, RawResponseType, ReadQuery, ReadResult, ReadableRelationName, RelatedIncludedResource, RelatedIncludedType, RelatedQuery, RelatedQueryDescriptor, RelatedQueryEntry, RelatedQueryOperation, RelatedQueryParam, RelationArrayEnvelope, RelationCollection, RelationDescriptor, RelationFilterQuery, RelationMutations, RelationName, RelationPageParams, RelationPaginator, RelationReadQuery, RelationSortQuery, RelationView, RelationshipAccessor, RelationshipDocument, ResolvedPaginator, ResolvedValidator, ResourceAccessors, ResourceCountOperation, ResourceCountToken, ResourceDescriptor, ResourceEnvelope, ResourceExamples, ResourceHandle, ResourceIdentifier, ResourceLinks, ResourceObjectView, SchemaMap, SingleReadQuery, SortFamilyDescriptor, SortQuery, SortToken, StrategyDescriptor, StructuralGuardError, ToDocumentOptions, TransportRawBody, TransportRequest, TransportResponse, TypeAccessor, TypeName, TypedPage, TypedReadQuery, TypedRelationReadQuery, UpdateInput, UpdateMethod, ValidationConfig, ValidationOption, Validator, WaitOptions, WaitValue, WaitedWriteResult, WireResource, WithLinks, WriteDocument, WriteOptions, WriteResult, assertJsonApiDocument, createClient, execute, executeRaw, executeResponse, fetchTransport, findError, hasErrorCode, isAccepted, isActionLocation, isPolymorphic, listFilterMatcher, materialise, mediaType, parseRetryAfter, readActionLocation, relatedPaginator, relatedPaginatorKind, remapPointer, remapRelationshipPointer, resolvePaginator, resolveValidator, runAtomic, serializeQuery, toDocument, toRelationshipDocument, validateDocument, withRemappedAtomicPaths, withRemappedPaths, withRemappedRelationshipPaths };
|
|
256
|
+
export { ATOMIC_EXT, ATOMIC_MEDIA_TYPE, type Accepted, AcceptedDescriptor, AcceptedJob, AcceptedOf, AcceptedOperation, ActionCallOptions, ActionDescriptor, ActionInput, ActionLocation, ActionLocationDescriptor, ActionOutput, ActionScope, ActionsAccessor, ApiDescriptor, ApiExamples, ArrayEnvelope, AtomicCreateHandle, AtomicCreateInput, AtomicDeleteHandle, AtomicDescriptor, AtomicHandle, AtomicRecorder, AtomicRef, AtomicResult, AtomicResultOf, AtomicResults, AtomicUpdateHandle, AtomicUpdateInput, BinaryBody, BinaryResponseType, CANONICAL_PAGE_KEYS, Cardinality, Client, ClientIdPolicy, ClientOptions, CodedErrorObject, Collection, CountAccessor, CountToken, CountableDescriptor, CountedRelationName, CreateInput, CreateMethod, DefaultActionTypes, DefaultAttributes, DefaultWriteAttributes, Document, DocumentEnvelope, Edge, EdgeEnvelope, EdgeMembers, ErrorCodeGuard, ErrorCodeOf, ErrorFinder, ExactPageParams, ExecutedResponse, FieldSelectionMap, FieldsMap, FilterFamilyDescriptor, FilterKey, FilterQuery, FilterSpec, HANDLE_RESERVED, HeadersInit, HydratedMember, IdentifierMember, IncludePath, IncludedRelations, IncludedResource, IncludedType, InputMedia, InputMediaKind, IsSingleton, JSON_API_MEDIA_TYPE, JsonApiContext, JsonApiError, JsonApiErrorObject, JsonApiRequest, JsonApiTransport, Link, LinkObject, LinkageRef, ListPageParams, LocalIdentifier, LooseRelatedQuery, LooseRelatedQueryEntry, MaterialiseContext, MediaExamples, MediaTypeParams, MemberName, MenuDescriptor, NavigateOptions, OperationExamples, Page, PageKeys, PageLinks, PageMeta, PageOf, PageParams, PageParamsOf, PaginatorDescriptor, PaginatorKind, PaginatorRole, PaginatorStrategy, PivotDescriptor, PivotInput, type PollOptions, PollTimeoutError, RawMediaKind, RawOutputMedia, RawResponseType, ReadQuery, ReadResult, ReadableRelationName, RelatedIncludedResource, RelatedIncludedType, RelatedQuery, RelatedQueryDescriptor, RelatedQueryEntry, RelatedQueryOperation, RelatedQueryParam, RelatedQueryRelation, RelatedReadRelatedQuery, RelationArrayEnvelope, RelationCollection, RelationDescriptor, RelationFilterQuery, RelationMutations, RelationName, RelationPageParams, RelationPaginator, RelationReadQuery, RelationSortQuery, RelationView, RelationshipAccessor, RelationshipDocument, ResolvedPaginator, ResolvedValidator, ResourceAccessors, ResourceCountOperation, ResourceCountToken, ResourceDescriptor, ResourceEnvelope, ResourceExamples, ResourceHandle, ResourceIdentifier, ResourceLinks, ResourceObjectView, SchemaMap, SingleReadQuery, SingletonAccessor, SingletonUpdateInput, SortFamilyDescriptor, SortQuery, SortToken, StrategyDescriptor, StructuralGuardError, ToDocumentOptions, TransportRawBody, TransportRequest, TransportResponse, TypeAccessor, TypeName, TypedPage, TypedReadQuery, TypedRelatedReadQuery, TypedRelationReadQuery, UpdateInput, UpdateMethod, ValidationConfig, ValidationOption, Validator, WaitOptions, WaitValue, WaitedWriteResult, WireResource, WithLinks, WriteDocument, WriteOptions, WriteResult, assertJsonApiDocument, createClient, execute, executeRaw, executeResponse, fetchTransport, findError, hasErrorCode, isAccepted, isActionLocation, isPolymorphic, listFilterMatcher, materialise, mediaType, parseRetryAfter, readActionLocation, relatedPaginator, relatedPaginatorKind, remapPointer, remapRelationshipPointer, resolvePaginator, resolveValidator, runAtomic, serializeQuery, toDocument, toRelationshipDocument, validateDocument, withRemappedAtomicPaths, withRemappedPaths, withRemappedRelationshipPaths };
|
|
257
257
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as IdentifierMember, $n as
|
|
1
|
+
import { $ as IdentifierMember, $n as ActionLocationDescriptor, $t as AtomicCreateHandle, A as AcceptedOf, An as relatedPaginator, Ar as isPolymorphic, At as ResourceHandle, B as CountedRelationName, Bn as PageParamsOf, Bt as TypedRelatedReadQuery, C as createClient, Cn as MaterialiseContext, Cr as RelationDescriptor, Ct as RelationPageParams, D as TransportResponse, Dn as ResourceEnvelope, Dr as ResourceExamples, Dt as RelationshipAccessor, E as TransportRequest, En as RelationView, Er as ResourceDescriptor, Et as RelationSortQuery, F as BinaryResponseType, Fn as PageKeys, Ft as SortQuery, G as DefaultWriteAttributes, Gn as PollOptions, Gt as WaitValue, H as CreateMethod, Hn as TypedPage, Ht as UpdateInput, I as Client, In as PageLinks, It as SortToken, J as FieldSelectionMap, Jn as parseRetryAfter, Jt as WriteOptions, K as EdgeMembers, Kn as PollTimeoutError, Kt as WaitedWriteResult, L as Collection, Ln as PageMeta, Lt as TypeAccessor, M as ActionsAccessor, Mn as CANONICAL_PAGE_KEYS, Mt as SingleReadQuery, N as AtomicResultOf, Nn as ExactPageParams, Nt as SingletonAccessor, O as fetchTransport, On as ResourceLinks, Or as SortFamilyDescriptor, Ot as ResourceAccessors, P as BinaryBody, Pn as Page, Pt as SingletonUpdateInput, Q as HydratedMember, Qn as ActionInput, Qt as readActionLocation, R as CountAccessor, Rn as PageOf, Rt as TypeName, S as HeadersInit, Sn as LinkObject, Sr as RelatedQueryOperation, St as RelationName, T as TransportRawBody, Tn as RelationArrayEnvelope, Tr as ResourceCountOperation, Tt as RelationReadQuery, U as DefaultActionTypes, Un as resolvePaginator, Ut as UpdateMethod, V as CreateInput, Vn as ResolvedPaginator, Vt as TypedRelationReadQuery, W as DefaultAttributes, Wn as Accepted, Wt as WaitOptions, X as FilterKey, Xn as AcceptedOperation, Xt as ActionLocation, Y as FieldsMap, Yn as AcceptedDescriptor, Yt as WriteResult, Z as FilterQuery, Zn as ActionDescriptor, Zt as isActionLocation, _ as executeRaw, _n as ArrayEnvelope, _r as PaginatorStrategy, _t as RelatedQueryParam, a as Validator, an as AtomicResult, ar as Cardinality, at as LinkageRef, b as ClientOptions, bn as EdgeEnvelope, br as RawOutputMedia, bt as RelationCollection, c as resolveValidator, cn as AtomicUpdateInput, cr as FilterFamilyDescriptor, ct as LooseRelatedQueryEntry, d as ExecutedResponse, dn as ATOMIC_MEDIA_TYPE, dr as MediaExamples, dt as ReadResult, en as AtomicCreateInput, er as ActionOutput, et as IncludePath, f as JsonApiContext, fn as JSON_API_MEDIA_TYPE, fr as MenuDescriptor, ft as ReadableRelationName, g as execute, gn as mediaType, gr as PaginatorRole, gt as RelatedQueryEntry, h as ReadQuery, hn as ResourceIdentifier, hr as PaginatorKind, ht as RelatedQuery, i as ValidationOption, in as AtomicRef, ir as AtomicDescriptor, it as IsSingleton, j as ActionCallOptions, jn as relatedPaginatorKind, jt as ResourceObjectView, k as AcceptedJob, kn as materialise, kr as StrategyDescriptor, kt as ResourceCountToken, l as validateDocument, ln as runAtomic, lr as InputMedia, lt as MemberName, m as RawResponseType, mn as MediaTypeParams, mr as PaginatorDescriptor, mt as RelatedIncludedType, n as SchemaMap, nn as AtomicHandle, nr as ApiDescriptor, nt as IncludedResource, o as WireResource, on as AtomicResults, or as ClientIdPolicy, ot as ListPageParams, p as JsonApiRequest, pn as LocalIdentifier, pr as OperationExamples, pt as RelatedIncludedResource, q as ErrorCodeOf, qn as isAccepted, qt as WithLinks, r as ValidationConfig, rn as AtomicRecorder, rr as ApiExamples, rt as IncludedType, s as assertJsonApiDocument, sn as AtomicUpdateHandle, sr as CountableDescriptor, st as LooseRelatedQuery, t as ResolvedValidator, tn as AtomicDeleteHandle, tr as ActionScope, tt as IncludedRelations, u as Document, un as ATOMIC_EXT, ur as InputMediaKind, ut as PivotInput, v as executeResponse, vn as DocumentEnvelope, vr as PivotDescriptor, vt as RelatedQueryRelation, w as JsonApiTransport, wn as NavigateOptions, wr as RelationMutations, wt as RelationPaginator, x as HANDLE_RESERVED, xn as Link, xr as RelatedQueryDescriptor, xt as RelationFilterQuery, y as serializeQuery, yn as Edge, yr as RawMediaKind, yt as RelatedReadRelatedQuery, z as CountToken, zn as PageParams, zt as TypedReadQuery } from "./validate-Cs7iAT9y.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/errors.d.ts
|
|
4
4
|
/**
|
|
@@ -253,5 +253,5 @@ declare function withRemappedRelationshipPaths(error: JsonApiError, rel: string,
|
|
|
253
253
|
*/
|
|
254
254
|
declare function withRemappedAtomicPaths(error: JsonApiError, descriptor: ApiDescriptor, typeForOp: (opIndex: number) => string | undefined): JsonApiError;
|
|
255
255
|
//#endregion
|
|
256
|
-
export { ATOMIC_EXT, ATOMIC_MEDIA_TYPE, type Accepted, AcceptedDescriptor, AcceptedJob, AcceptedOf, AcceptedOperation, ActionCallOptions, ActionDescriptor, ActionInput, ActionLocation, ActionLocationDescriptor, ActionOutput, ActionScope, ActionsAccessor, ApiDescriptor, ApiExamples, ArrayEnvelope, AtomicCreateHandle, AtomicCreateInput, AtomicDeleteHandle, AtomicDescriptor, AtomicHandle, AtomicRecorder, AtomicRef, AtomicResult, AtomicResultOf, AtomicResults, AtomicUpdateHandle, AtomicUpdateInput, BinaryBody, BinaryResponseType, CANONICAL_PAGE_KEYS, Cardinality, Client, ClientIdPolicy, ClientOptions, CodedErrorObject, Collection, CountAccessor, CountToken, CountableDescriptor, CountedRelationName, CreateInput, CreateMethod, DefaultActionTypes, DefaultAttributes, DefaultWriteAttributes, Document, DocumentEnvelope, Edge, EdgeEnvelope, EdgeMembers, ErrorCodeGuard, ErrorCodeOf, ErrorFinder, ExactPageParams, ExecutedResponse, FieldSelectionMap, FieldsMap, FilterFamilyDescriptor, FilterKey, FilterQuery, FilterSpec, HANDLE_RESERVED, HeadersInit, HydratedMember, IdentifierMember, IncludePath, IncludedRelations, IncludedResource, IncludedType, InputMedia, InputMediaKind, JSON_API_MEDIA_TYPE, JsonApiContext, JsonApiError, JsonApiErrorObject, JsonApiRequest, JsonApiTransport, Link, LinkObject, LinkageRef, ListPageParams, LocalIdentifier, LooseRelatedQueryEntry, MaterialiseContext, MediaExamples, MediaTypeParams, MemberName, MenuDescriptor, NavigateOptions, OperationExamples, Page, PageKeys, PageLinks, PageMeta, PageOf, PageParams, PageParamsOf, PaginatorDescriptor, PaginatorKind, PaginatorRole, PaginatorStrategy, PivotDescriptor, PivotInput, type PollOptions, PollTimeoutError, RawMediaKind, RawOutputMedia, RawResponseType, ReadQuery, ReadResult, ReadableRelationName, RelatedIncludedResource, RelatedIncludedType, RelatedQuery, RelatedQueryDescriptor, RelatedQueryEntry, RelatedQueryOperation, RelatedQueryParam, RelationArrayEnvelope, RelationCollection, RelationDescriptor, RelationFilterQuery, RelationMutations, RelationName, RelationPageParams, RelationPaginator, RelationReadQuery, RelationSortQuery, RelationView, RelationshipAccessor, RelationshipDocument, ResolvedPaginator, ResolvedValidator, ResourceAccessors, ResourceCountOperation, ResourceCountToken, ResourceDescriptor, ResourceEnvelope, ResourceExamples, ResourceHandle, ResourceIdentifier, ResourceLinks, ResourceObjectView, SchemaMap, SingleReadQuery, SortFamilyDescriptor, SortQuery, SortToken, StrategyDescriptor, StructuralGuardError, ToDocumentOptions, TransportRawBody, TransportRequest, TransportResponse, TypeAccessor, TypeName, TypedPage, TypedReadQuery, TypedRelationReadQuery, UpdateInput, UpdateMethod, ValidationConfig, ValidationOption, Validator, WaitOptions, WaitValue, WaitedWriteResult, WireResource, WithLinks, WriteDocument, WriteOptions, WriteResult, assertJsonApiDocument, createClient, execute, executeRaw, executeResponse, fetchTransport, findError, hasErrorCode, isAccepted, isActionLocation, isPolymorphic, listFilterMatcher, materialise, mediaType, parseRetryAfter, readActionLocation, relatedPaginator, relatedPaginatorKind, remapPointer, remapRelationshipPointer, resolvePaginator, resolveValidator, runAtomic, serializeQuery, toDocument, toRelationshipDocument, validateDocument, withRemappedAtomicPaths, withRemappedPaths, withRemappedRelationshipPaths };
|
|
256
|
+
export { ATOMIC_EXT, ATOMIC_MEDIA_TYPE, type Accepted, AcceptedDescriptor, AcceptedJob, AcceptedOf, AcceptedOperation, ActionCallOptions, ActionDescriptor, ActionInput, ActionLocation, ActionLocationDescriptor, ActionOutput, ActionScope, ActionsAccessor, ApiDescriptor, ApiExamples, ArrayEnvelope, AtomicCreateHandle, AtomicCreateInput, AtomicDeleteHandle, AtomicDescriptor, AtomicHandle, AtomicRecorder, AtomicRef, AtomicResult, AtomicResultOf, AtomicResults, AtomicUpdateHandle, AtomicUpdateInput, BinaryBody, BinaryResponseType, CANONICAL_PAGE_KEYS, Cardinality, Client, ClientIdPolicy, ClientOptions, CodedErrorObject, Collection, CountAccessor, CountToken, CountableDescriptor, CountedRelationName, CreateInput, CreateMethod, DefaultActionTypes, DefaultAttributes, DefaultWriteAttributes, Document, DocumentEnvelope, Edge, EdgeEnvelope, EdgeMembers, ErrorCodeGuard, ErrorCodeOf, ErrorFinder, ExactPageParams, ExecutedResponse, FieldSelectionMap, FieldsMap, FilterFamilyDescriptor, FilterKey, FilterQuery, FilterSpec, HANDLE_RESERVED, HeadersInit, HydratedMember, IdentifierMember, IncludePath, IncludedRelations, IncludedResource, IncludedType, InputMedia, InputMediaKind, IsSingleton, JSON_API_MEDIA_TYPE, JsonApiContext, JsonApiError, JsonApiErrorObject, JsonApiRequest, JsonApiTransport, Link, LinkObject, LinkageRef, ListPageParams, LocalIdentifier, LooseRelatedQuery, LooseRelatedQueryEntry, MaterialiseContext, MediaExamples, MediaTypeParams, MemberName, MenuDescriptor, NavigateOptions, OperationExamples, Page, PageKeys, PageLinks, PageMeta, PageOf, PageParams, PageParamsOf, PaginatorDescriptor, PaginatorKind, PaginatorRole, PaginatorStrategy, PivotDescriptor, PivotInput, type PollOptions, PollTimeoutError, RawMediaKind, RawOutputMedia, RawResponseType, ReadQuery, ReadResult, ReadableRelationName, RelatedIncludedResource, RelatedIncludedType, RelatedQuery, RelatedQueryDescriptor, RelatedQueryEntry, RelatedQueryOperation, RelatedQueryParam, RelatedQueryRelation, RelatedReadRelatedQuery, RelationArrayEnvelope, RelationCollection, RelationDescriptor, RelationFilterQuery, RelationMutations, RelationName, RelationPageParams, RelationPaginator, RelationReadQuery, RelationSortQuery, RelationView, RelationshipAccessor, RelationshipDocument, ResolvedPaginator, ResolvedValidator, ResourceAccessors, ResourceCountOperation, ResourceCountToken, ResourceDescriptor, ResourceEnvelope, ResourceExamples, ResourceHandle, ResourceIdentifier, ResourceLinks, ResourceObjectView, SchemaMap, SingleReadQuery, SingletonAccessor, SingletonUpdateInput, SortFamilyDescriptor, SortQuery, SortToken, StrategyDescriptor, StructuralGuardError, ToDocumentOptions, TransportRawBody, TransportRequest, TransportResponse, TypeAccessor, TypeName, TypedPage, TypedReadQuery, TypedRelatedReadQuery, TypedRelationReadQuery, UpdateInput, UpdateMethod, ValidationConfig, ValidationOption, Validator, WaitOptions, WaitValue, WaitedWriteResult, WireResource, WithLinks, WriteDocument, WriteOptions, WriteResult, assertJsonApiDocument, createClient, execute, executeRaw, executeResponse, fetchTransport, findError, hasErrorCode, isAccepted, isActionLocation, isPolymorphic, listFilterMatcher, materialise, mediaType, parseRetryAfter, readActionLocation, relatedPaginator, relatedPaginatorKind, remapPointer, remapRelationshipPointer, resolvePaginator, resolveValidator, runAtomic, serializeQuery, toDocument, toRelationshipDocument, validateDocument, withRemappedAtomicPaths, withRemappedPaths, withRemappedRelationshipPaths };
|
|
257
257
|
//# sourceMappingURL=index.d.mts.map
|