@sanity/client 8.7.0 → 8.9.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 +24 -6
- package/dist/collaboration.d.ts +33 -0
- package/dist/collaboration.js +2 -0
- package/dist/getCommentTargetDocumentRef-B8NuiBjG.js +31 -0
- package/dist/getCommentTargetDocumentRef-B8NuiBjG.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +28 -5
- package/dist/index.js.map +1 -1
- package/dist/index.node.d.ts +1979 -431
- package/dist/index.node.js +54 -6
- package/dist/index.node.js.map +1 -1
- package/dist/media-library.d.ts +1 -1
- package/dist/{types-Do7-A3K9.d.ts → types-KoKIKv8Z.d.ts} +1980 -432
- package/package.json +2 -1
- package/src/collaboration/comments.ts +30 -7
- package/src/collaboration/getCommentTargetDocumentRef.ts +45 -0
- package/src/collaboration/index.ts +1 -0
- package/src/collaboration/types.ts +105 -13
- package/src/context/openapi.json +2588 -1442
- package/src/context/types.gen.ts +1904 -491
- package/src/types.ts +1 -0
package/dist/index.node.d.ts
CHANGED
|
@@ -1369,6 +1369,7 @@ interface CollaborationCommentDocument extends SanityDocument {
|
|
|
1369
1369
|
* Each endpoint pairs the `_key` of a Portable Text block with a character
|
|
1370
1370
|
* offset into that block's plain text.
|
|
1371
1371
|
*
|
|
1372
|
+
* @deprecated Use {@link CollaborationCommentAnchor}.
|
|
1372
1373
|
* @alpha
|
|
1373
1374
|
*/
|
|
1374
1375
|
interface CollaborationCommentRange {
|
|
@@ -1382,8 +1383,8 @@ interface CollaborationCommentRange {
|
|
|
1382
1383
|
};
|
|
1383
1384
|
}
|
|
1384
1385
|
/**
|
|
1385
|
-
* Portable Text covering
|
|
1386
|
-
* from the
|
|
1386
|
+
* Portable Text covering an inline comment anchor. Callers can send just the
|
|
1387
|
+
* blocks from the anchor start `_key` through end `_key`, or the full field.
|
|
1387
1388
|
*
|
|
1388
1389
|
* @alpha
|
|
1389
1390
|
*/
|
|
@@ -1392,16 +1393,38 @@ type CollaborationCommentFieldValue = Array<{
|
|
|
1392
1393
|
_key: string;
|
|
1393
1394
|
[key: string]: Any;
|
|
1394
1395
|
}>;
|
|
1396
|
+
/**
|
|
1397
|
+
* Where in `path` a comment is anchored.
|
|
1398
|
+
*
|
|
1399
|
+
* For `portable-text`, each endpoint pairs the `_key` of a Portable Text
|
|
1400
|
+
* block with a character offset into that block's plain text. An optional
|
|
1401
|
+
* `fieldValue` is Portable Text covering the anchor. When set, the selection
|
|
1402
|
+
* is resolved from those blocks instead of from the live document.
|
|
1403
|
+
*
|
|
1404
|
+
* @alpha
|
|
1405
|
+
*/
|
|
1406
|
+
type CollaborationCommentAnchor = {
|
|
1407
|
+
type: 'portable-text';
|
|
1408
|
+
start: {
|
|
1409
|
+
_key: string;
|
|
1410
|
+
offset: number;
|
|
1411
|
+
};
|
|
1412
|
+
end: {
|
|
1413
|
+
_key: string;
|
|
1414
|
+
offset: number;
|
|
1415
|
+
};
|
|
1416
|
+
fieldValue?: CollaborationCommentFieldValue;
|
|
1417
|
+
};
|
|
1395
1418
|
/**
|
|
1396
1419
|
* Target for a top-level comment. Inline selections require both `path` and
|
|
1397
|
-
* `
|
|
1420
|
+
* `anchor`; field-level comments may set `path` alone.
|
|
1398
1421
|
*
|
|
1399
1422
|
* The created comment stores this in a different shape: `path` becomes
|
|
1400
|
-
* `target.path.field`, and `
|
|
1423
|
+
* `target.path.field`, and `anchor` is resolved against the document into
|
|
1401
1424
|
* `target.path.selection` and `contentSnapshot` rather than being stored.
|
|
1402
1425
|
*
|
|
1403
|
-
*
|
|
1404
|
-
*
|
|
1426
|
+
* Deprecated `range` + top-level `fieldValue` are still accepted and converted
|
|
1427
|
+
* to a `portable-text` `anchor` before the request is sent.
|
|
1405
1428
|
*
|
|
1406
1429
|
* @alpha
|
|
1407
1430
|
*/
|
|
@@ -1412,16 +1435,41 @@ type CollaborationCommentTarget = {
|
|
|
1412
1435
|
} & ({
|
|
1413
1436
|
/** Path to the field containing the inline comment selection */
|
|
1414
1437
|
path: string;
|
|
1438
|
+
anchor: CollaborationCommentAnchor;
|
|
1439
|
+
/**
|
|
1440
|
+
* @deprecated Use `anchor`.
|
|
1441
|
+
*/
|
|
1442
|
+
range?: never;
|
|
1443
|
+
/**
|
|
1444
|
+
* @deprecated Use `anchor.fieldValue`.
|
|
1445
|
+
*/
|
|
1446
|
+
fieldValue?: never;
|
|
1447
|
+
} | {
|
|
1448
|
+
/** Path to the field containing the inline comment selection */
|
|
1449
|
+
path: string;
|
|
1450
|
+
/**
|
|
1451
|
+
* @deprecated Use `anchor`.
|
|
1452
|
+
*/
|
|
1415
1453
|
range: CollaborationCommentRange;
|
|
1416
1454
|
/**
|
|
1417
|
-
* Portable Text covering the `range`. When set, the
|
|
1455
|
+
* Portable Text covering the `range`. When set, the selection is resolved
|
|
1418
1456
|
* from these blocks instead of from the live document.
|
|
1457
|
+
*
|
|
1458
|
+
* @deprecated Use `anchor.fieldValue`.
|
|
1419
1459
|
*/
|
|
1420
1460
|
fieldValue?: CollaborationCommentFieldValue;
|
|
1461
|
+
anchor?: never;
|
|
1421
1462
|
} | {
|
|
1422
1463
|
/** Path to the commented field */
|
|
1423
1464
|
path?: string;
|
|
1465
|
+
anchor?: never;
|
|
1466
|
+
/**
|
|
1467
|
+
* @deprecated Use `anchor`.
|
|
1468
|
+
*/
|
|
1424
1469
|
range?: never;
|
|
1470
|
+
/**
|
|
1471
|
+
* @deprecated Use `anchor.fieldValue`.
|
|
1472
|
+
*/
|
|
1425
1473
|
fieldValue?: never;
|
|
1426
1474
|
});
|
|
1427
1475
|
/**
|
|
@@ -1449,7 +1497,11 @@ type CollaborationCommentTarget = {
|
|
|
1449
1497
|
* documentId: 'doc-1',
|
|
1450
1498
|
* documentType: 'article',
|
|
1451
1499
|
* path: 'body',
|
|
1452
|
-
*
|
|
1500
|
+
* anchor: {
|
|
1501
|
+
* type: 'portable-text',
|
|
1502
|
+
* start: {_key: 'block-1', offset: 0},
|
|
1503
|
+
* end: {_key: 'block-1', offset: 5},
|
|
1504
|
+
* },
|
|
1453
1505
|
* },
|
|
1454
1506
|
* })
|
|
1455
1507
|
* ```
|
|
@@ -1481,11 +1533,13 @@ type CollaborationCommentCreate = {
|
|
|
1481
1533
|
/**
|
|
1482
1534
|
* Fields that can be updated on an existing comment.
|
|
1483
1535
|
*
|
|
1484
|
-
*
|
|
1536
|
+
* An `anchor` re-anchors the comment within the field it already targets.
|
|
1485
1537
|
* Pass `null` to remove the selection and leave a field-level comment.
|
|
1486
|
-
* An optional `fieldValue`
|
|
1487
|
-
*
|
|
1488
|
-
*
|
|
1538
|
+
* An optional `fieldValue` on a `portable-text` anchor is resolved from those
|
|
1539
|
+
* blocks instead of from the live document.
|
|
1540
|
+
*
|
|
1541
|
+
* Deprecated `range` + top-level `fieldValue` (and `range: null`) are still
|
|
1542
|
+
* accepted and converted to `anchor` before the request is sent.
|
|
1489
1543
|
*
|
|
1490
1544
|
* @alpha
|
|
1491
1545
|
*/
|
|
@@ -1495,17 +1549,57 @@ type CollaborationCommentUpdate = {
|
|
|
1495
1549
|
/** Cascades to the comment's replies */
|
|
1496
1550
|
status?: CollaborationCommentStatus;
|
|
1497
1551
|
} & ({
|
|
1552
|
+
anchor: CollaborationCommentAnchor;
|
|
1553
|
+
/**
|
|
1554
|
+
* @deprecated Use `anchor`.
|
|
1555
|
+
*/
|
|
1556
|
+
range?: never;
|
|
1557
|
+
/**
|
|
1558
|
+
* @deprecated Use `anchor.fieldValue`.
|
|
1559
|
+
*/
|
|
1560
|
+
fieldValue?: never;
|
|
1561
|
+
} | {
|
|
1562
|
+
anchor: null;
|
|
1563
|
+
/**
|
|
1564
|
+
* @deprecated Use `anchor`.
|
|
1565
|
+
*/
|
|
1566
|
+
range?: never;
|
|
1567
|
+
/**
|
|
1568
|
+
* @deprecated Use `anchor.fieldValue`.
|
|
1569
|
+
*/
|
|
1570
|
+
fieldValue?: never;
|
|
1571
|
+
} | {
|
|
1572
|
+
/**
|
|
1573
|
+
* @deprecated Use `anchor`.
|
|
1574
|
+
*/
|
|
1498
1575
|
range: CollaborationCommentRange;
|
|
1499
1576
|
/**
|
|
1500
|
-
* Portable Text covering the `range`. When set, the
|
|
1577
|
+
* Portable Text covering the `range`. When set, the selection is resolved
|
|
1501
1578
|
* from these blocks instead of from the live document.
|
|
1579
|
+
*
|
|
1580
|
+
* @deprecated Use `anchor.fieldValue`.
|
|
1502
1581
|
*/
|
|
1503
1582
|
fieldValue?: CollaborationCommentFieldValue;
|
|
1583
|
+
anchor?: never;
|
|
1504
1584
|
} | {
|
|
1585
|
+
/**
|
|
1586
|
+
* @deprecated Use `anchor: null`.
|
|
1587
|
+
*/
|
|
1505
1588
|
range: null;
|
|
1589
|
+
/**
|
|
1590
|
+
* @deprecated Use `anchor.fieldValue`.
|
|
1591
|
+
*/
|
|
1506
1592
|
fieldValue?: never;
|
|
1593
|
+
anchor?: never;
|
|
1507
1594
|
} | {
|
|
1595
|
+
anchor?: undefined;
|
|
1596
|
+
/**
|
|
1597
|
+
* @deprecated Use `anchor`.
|
|
1598
|
+
*/
|
|
1508
1599
|
range?: undefined;
|
|
1600
|
+
/**
|
|
1601
|
+
* @deprecated Use `anchor.fieldValue`.
|
|
1602
|
+
*/
|
|
1509
1603
|
fieldValue?: never;
|
|
1510
1604
|
});
|
|
1511
1605
|
/**
|
|
@@ -1752,13 +1846,13 @@ interface paths {
|
|
|
1752
1846
|
};
|
|
1753
1847
|
/**
|
|
1754
1848
|
* List knowledge bases
|
|
1755
|
-
* @description Returns the
|
|
1849
|
+
* @description Returns the knowledge bases you can access in the organization set by `organizationId`. Results are cursor-paginated.
|
|
1756
1850
|
*/
|
|
1757
1851
|
get: operations['listKnowledgeBases'];
|
|
1758
1852
|
put?: never;
|
|
1759
1853
|
/**
|
|
1760
1854
|
* Create a knowledge base
|
|
1761
|
-
* @description Creates a knowledge base
|
|
1855
|
+
* @description Creates a knowledge base in your organization. To add content to it, create an import.
|
|
1762
1856
|
*/
|
|
1763
1857
|
post: operations['createKnowledgeBase'];
|
|
1764
1858
|
delete?: never;
|
|
@@ -1776,21 +1870,21 @@ interface paths {
|
|
|
1776
1870
|
};
|
|
1777
1871
|
/**
|
|
1778
1872
|
* Get a knowledge base
|
|
1779
|
-
* @description Returns
|
|
1873
|
+
* @description Returns a knowledge base's metadata and state. `knowledgeBaseId` accepts the public ID (`kb...`) or the UUID, and you don't need to pass an organization. If you can't read the knowledge base, the request returns `404`. To read the built entries, query `sanity.context.entry` documents with GROQ from your organization's document store.
|
|
1780
1874
|
*/
|
|
1781
1875
|
get: operations['getKnowledgeBase'];
|
|
1782
1876
|
put?: never;
|
|
1783
1877
|
post?: never;
|
|
1784
1878
|
/**
|
|
1785
1879
|
* Delete a knowledge base
|
|
1786
|
-
* @description
|
|
1880
|
+
* @description Deletes the knowledge base and everything it owns: its sources, imports, revisions, stored source files, and its documents in your organization's document store. While a build, refresh, apply, or import is running, the request returns `409` with code `buildInFlight`. Retry after that work finishes.
|
|
1787
1881
|
*/
|
|
1788
1882
|
delete: operations['deleteKnowledgeBase'];
|
|
1789
1883
|
options?: never;
|
|
1790
1884
|
head?: never;
|
|
1791
1885
|
/**
|
|
1792
1886
|
* Update a knowledge base
|
|
1793
|
-
* @description
|
|
1887
|
+
* @description Updates the title, the description, or the recurring refresh settings (`refreshEnabled` and `refreshFrequency`). Setting a refresh field on a knowledge base with no website or dataset source returns `422` with code `refreshControlsUnavailable`. Setting `refreshEnabled` to `false` pauses the schedule, and you can still start a refresh manually.
|
|
1794
1888
|
*/
|
|
1795
1889
|
patch: operations['updateKnowledgeBase'];
|
|
1796
1890
|
trace?: never;
|
|
@@ -1805,8 +1899,8 @@ interface paths {
|
|
|
1805
1899
|
get?: never;
|
|
1806
1900
|
put?: never;
|
|
1807
1901
|
/**
|
|
1808
|
-
*
|
|
1809
|
-
* @description Queues a build over the current
|
|
1902
|
+
* Start a knowledge base build
|
|
1903
|
+
* @description Queues a build over the knowledge base's current sources and returns a job ID immediately. If a build is already running, the response returns that build's job ID instead of starting a second build.
|
|
1810
1904
|
*/
|
|
1811
1905
|
post: operations['buildKnowledgeBase'];
|
|
1812
1906
|
delete?: never;
|
|
@@ -1825,8 +1919,8 @@ interface paths {
|
|
|
1825
1919
|
get?: never;
|
|
1826
1920
|
put?: never;
|
|
1827
1921
|
/**
|
|
1828
|
-
* Cancel
|
|
1829
|
-
* @description Cancels the running build and resets the knowledge base so
|
|
1922
|
+
* Cancel a knowledge base build
|
|
1923
|
+
* @description Cancels the running build and resets the knowledge base so you can build it again. Returns `cancelled: false` when no build is running.
|
|
1830
1924
|
*/
|
|
1831
1925
|
post: operations['cancelKnowledgeBaseBuild'];
|
|
1832
1926
|
delete?: never;
|
|
@@ -1846,7 +1940,7 @@ interface paths {
|
|
|
1846
1940
|
put?: never;
|
|
1847
1941
|
/**
|
|
1848
1942
|
* Rebuild an entry from its sources
|
|
1849
|
-
* @description Queues a
|
|
1943
|
+
* @description Queues a rewrite of the entry at `entryPath` from its cited sources and the active instructions, and returns a job ID immediately. The response also lists the other entries that cite any of the same sources. An instruction applies to every entry that cites its sources, so those entries can change too.
|
|
1850
1944
|
*/
|
|
1851
1945
|
post: operations['rebuildEntry'];
|
|
1852
1946
|
delete?: never;
|
|
@@ -1864,13 +1958,21 @@ interface paths {
|
|
|
1864
1958
|
};
|
|
1865
1959
|
/**
|
|
1866
1960
|
* List imports
|
|
1867
|
-
* @description
|
|
1961
|
+
* @description Lists everything added to a knowledge base, one item per import: a file upload, website crawl, Sanity dataset, or inline text. Results are cursor-paginated. To list the sources each import produced, use `GET .../sources`.
|
|
1868
1962
|
*/
|
|
1869
1963
|
get: operations['listImports'];
|
|
1870
1964
|
put?: never;
|
|
1871
1965
|
/**
|
|
1872
|
-
* Create
|
|
1873
|
-
* @description Adds content
|
|
1966
|
+
* Create a text, crawl, or dataset import
|
|
1967
|
+
* @description Adds content to a knowledge base. Set `type` to choose what to import:
|
|
1968
|
+
*
|
|
1969
|
+
* - `text`: inline content
|
|
1970
|
+
* - `crawl`: a website
|
|
1971
|
+
* - `dataset`: documents from a Sanity dataset, selected by a GROQ filter
|
|
1972
|
+
*
|
|
1973
|
+
* Each import queues processing and returns a job ID to poll. To import a file, use `POST .../imports/uploads` instead.
|
|
1974
|
+
*
|
|
1975
|
+
* Adding a crawl URL that already exists returns `409` with code `webSourceRootConflict`. Adding more crawl URLs than your limit allows returns `409` with code `webSourceRootLimitExceeded`. Supports the `Idempotency-Key` header.
|
|
1874
1976
|
*/
|
|
1875
1977
|
post: operations['createImport'];
|
|
1876
1978
|
delete?: never;
|
|
@@ -1889,8 +1991,13 @@ interface paths {
|
|
|
1889
1991
|
get?: never;
|
|
1890
1992
|
put?: never;
|
|
1891
1993
|
/**
|
|
1892
|
-
* Start a file
|
|
1893
|
-
* @description Creates a file
|
|
1994
|
+
* Start a file upload
|
|
1995
|
+
* @description Creates a file import and returns a single-use signed upload URL that's valid for one hour. To finish the upload:
|
|
1996
|
+
*
|
|
1997
|
+
* 1. Send the file in a `PUT` request to the upload URL.
|
|
1998
|
+
* 2. Call `POST .../imports/uploads/{importId}/complete` to start processing.
|
|
1999
|
+
*
|
|
2000
|
+
* If you set `contentType`, the `PUT` request must send the same `Content-Type` header. If you omit it, the `PUT` request can send any `Content-Type` header or none. An import that isn't completed within 24 hours is deleted. Supports the `Idempotency-Key` header.
|
|
1894
2001
|
*/
|
|
1895
2002
|
post: operations['startUpload'];
|
|
1896
2003
|
delete?: never;
|
|
@@ -1909,8 +2016,8 @@ interface paths {
|
|
|
1909
2016
|
get?: never;
|
|
1910
2017
|
put?: never;
|
|
1911
2018
|
/**
|
|
1912
|
-
* Complete a file
|
|
1913
|
-
* @description
|
|
2019
|
+
* Complete a file upload
|
|
2020
|
+
* @description Starts processing a file after you upload it to the signed URL from `POST .../imports/uploads`. Returns a job ID to poll.
|
|
1914
2021
|
*/
|
|
1915
2022
|
post: operations['completeUpload'];
|
|
1916
2023
|
delete?: never;
|
|
@@ -1927,15 +2034,15 @@ interface paths {
|
|
|
1927
2034
|
cookie?: never;
|
|
1928
2035
|
};
|
|
1929
2036
|
/**
|
|
1930
|
-
* Get
|
|
1931
|
-
* @description Returns
|
|
2037
|
+
* Get an import
|
|
2038
|
+
* @description Returns an import with its `sourceKind` and processing `status`.
|
|
1932
2039
|
*/
|
|
1933
2040
|
get: operations['getImport'];
|
|
1934
2041
|
put?: never;
|
|
1935
2042
|
post?: never;
|
|
1936
2043
|
/**
|
|
1937
2044
|
* Delete an import
|
|
1938
|
-
* @description
|
|
2045
|
+
* @description Deletes the import and every source it produced, and cancels its processing if it is still running. Use it to remove content you added by mistake.
|
|
1939
2046
|
*/
|
|
1940
2047
|
delete: operations['deleteImport'];
|
|
1941
2048
|
options?: never;
|
|
@@ -1952,7 +2059,7 @@ interface paths {
|
|
|
1952
2059
|
};
|
|
1953
2060
|
/**
|
|
1954
2061
|
* Get a download URL for an import
|
|
1955
|
-
* @description
|
|
2062
|
+
* @description Returns a short-lived signed URL that downloads the import's original content. Use the URL before `expiresAt`. Only file and text imports keep their original content. For crawl and dataset imports, the request returns `409` with code `importInvalidState`.
|
|
1956
2063
|
*/
|
|
1957
2064
|
get: operations['downloadImport'];
|
|
1958
2065
|
put?: never;
|
|
@@ -1973,8 +2080,8 @@ interface paths {
|
|
|
1973
2080
|
get?: never;
|
|
1974
2081
|
put?: never;
|
|
1975
2082
|
/**
|
|
1976
|
-
*
|
|
1977
|
-
* @description Creates a standing
|
|
2083
|
+
* Create an instruction
|
|
2084
|
+
* @description Creates a standing instruction for how entries that cite its sources are written. Every instruction applies to specific sources, set in `scopeSourceIds`. To rebuild entries under the new instruction right away, pass their paths in `rebuildPaths`. The response includes the rebuild job ID, or `null` if the rebuild could not start. The instruction is saved either way. After the instruction is saved, a background check files issues for entries that contradict it. If you already checked the instruction for contradictions, set `verified` to skip the background check. If the requested rebuild does not start, the background check runs even when `verified` is set.
|
|
1978
2085
|
*/
|
|
1979
2086
|
post: operations['createInstruction'];
|
|
1980
2087
|
delete?: never;
|
|
@@ -1995,14 +2102,14 @@ interface paths {
|
|
|
1995
2102
|
post?: never;
|
|
1996
2103
|
/**
|
|
1997
2104
|
* Delete an instruction
|
|
1998
|
-
* @description Deletes the
|
|
2105
|
+
* @description Deletes the instruction. Builds stop applying it from the next run.
|
|
1999
2106
|
*/
|
|
2000
2107
|
delete: operations['deleteInstruction'];
|
|
2001
2108
|
options?: never;
|
|
2002
2109
|
head?: never;
|
|
2003
2110
|
/**
|
|
2004
|
-
*
|
|
2005
|
-
* @description
|
|
2111
|
+
* Update an instruction
|
|
2112
|
+
* @description Updates the instruction's statement or sources. The change applies from the next build. Any update also reactivates an archived instruction and ties it to the current content of its sources.
|
|
2006
2113
|
*/
|
|
2007
2114
|
patch: operations['updateInstruction'];
|
|
2008
2115
|
trace?: never;
|
|
@@ -2017,8 +2124,8 @@ interface paths {
|
|
|
2017
2124
|
get?: never;
|
|
2018
2125
|
put?: never;
|
|
2019
2126
|
/**
|
|
2020
|
-
*
|
|
2021
|
-
* @description
|
|
2127
|
+
* Accept and apply issues
|
|
2128
|
+
* @description Accepts the issues in `issueIds`, then queues a job that applies them, rewrites the affected entries, and saves a new revision. Returns a job ID. IDs of issues that no longer exist are skipped.
|
|
2022
2129
|
*/
|
|
2023
2130
|
post: operations['applyIssues'];
|
|
2024
2131
|
delete?: never;
|
|
@@ -2038,7 +2145,7 @@ interface paths {
|
|
|
2038
2145
|
put?: never;
|
|
2039
2146
|
/**
|
|
2040
2147
|
* Dismiss an issue
|
|
2041
|
-
* @description Marks the issue rejected.
|
|
2148
|
+
* @description Marks the issue as rejected. If the issue already left triage, the request returns it unchanged. Returns `422` with code `issueDocumentInvalid` if the issue document was edited into a shape the API cannot verify. Returns `409` with code `issueTransitionConflict` if another change to the issue happened at the same time. You can safely retry a `409`.
|
|
2042
2149
|
*/
|
|
2043
2150
|
post: operations['dismissIssue'];
|
|
2044
2151
|
delete?: never;
|
|
@@ -2058,7 +2165,7 @@ interface paths {
|
|
|
2058
2165
|
put?: never;
|
|
2059
2166
|
/**
|
|
2060
2167
|
* Reopen an accepted conflict
|
|
2061
|
-
* @description Returns an accepted conflict to triage,
|
|
2168
|
+
* @description Returns an accepted conflict issue to triage, clears its resolution, and deletes the instruction the resolution created. Reopening an open or dismissed conflict returns it unchanged. Other issue types return `422` with code `issueNotResolvable`.
|
|
2062
2169
|
*/
|
|
2063
2170
|
post: operations['reopenIssue'];
|
|
2064
2171
|
delete?: never;
|
|
@@ -2078,7 +2185,7 @@ interface paths {
|
|
|
2078
2185
|
put?: never;
|
|
2079
2186
|
/**
|
|
2080
2187
|
* Resolve a conflict issue
|
|
2081
|
-
* @description
|
|
2188
|
+
* @description Resolves a conflict issue by choosing one of its sides. Set `resolution` to the index of a side in `content.sides`. For a conflict on a single entry, index `0` is the entry's current content, so choosing it keeps the entry as it is. Choosing any other side rewrites the entry, and the returned `jobId` tracks the rewrite. The decision becomes a standing instruction for every future build, and `resolvedBy` records who made it. To change a decision, resolve the accepted conflict again. Other issue types, dismissed conflicts, and out-of-range indexes return `422` with code `issueNotResolvable`.
|
|
2082
2189
|
*/
|
|
2083
2190
|
post: operations['resolveIssue'];
|
|
2084
2191
|
delete?: never;
|
|
@@ -2095,8 +2202,8 @@ interface paths {
|
|
|
2095
2202
|
cookie?: never;
|
|
2096
2203
|
};
|
|
2097
2204
|
/**
|
|
2098
|
-
* Get a job
|
|
2099
|
-
* @description Returns the status of a job, such as a build or
|
|
2205
|
+
* Get a job
|
|
2206
|
+
* @description Returns the status of a background job, such as a build, import, or refresh. The endpoint that starts the work returns the job ID.
|
|
2100
2207
|
*/
|
|
2101
2208
|
get: operations['getJob'];
|
|
2102
2209
|
put?: never;
|
|
@@ -2117,8 +2224,8 @@ interface paths {
|
|
|
2117
2224
|
get?: never;
|
|
2118
2225
|
put?: never;
|
|
2119
2226
|
/**
|
|
2120
|
-
*
|
|
2121
|
-
* @description Queues a refresh
|
|
2227
|
+
* Refresh a knowledge base
|
|
2228
|
+
* @description Queues a refresh that recrawls website sources, re-syncs dataset sources, compares the result with the last build, and files issues for what changed. Returns a job ID. If a refresh is already running, the response has `started: false` and that refresh's job ID. Supports the `Idempotency-Key` header.
|
|
2122
2229
|
*/
|
|
2123
2230
|
post: operations['refreshKnowledgeBase'];
|
|
2124
2231
|
delete?: never;
|
|
@@ -2136,7 +2243,7 @@ interface paths {
|
|
|
2136
2243
|
};
|
|
2137
2244
|
/**
|
|
2138
2245
|
* List sources
|
|
2139
|
-
* @description
|
|
2246
|
+
* @description Lists the sources in a knowledge base: the pages, files, and documents that imports produce and builds cite. Sources are read-only. To add content, create an import. Results are cursor-paginated, and you can filter them by `status`.
|
|
2140
2247
|
*/
|
|
2141
2248
|
get: operations['listSources'];
|
|
2142
2249
|
put?: never;
|
|
@@ -2155,15 +2262,15 @@ interface paths {
|
|
|
2155
2262
|
cookie?: never;
|
|
2156
2263
|
};
|
|
2157
2264
|
/**
|
|
2158
|
-
* Get a
|
|
2159
|
-
* @description Returns
|
|
2265
|
+
* Get a source
|
|
2266
|
+
* @description Returns a source with its metadata and processing status.
|
|
2160
2267
|
*/
|
|
2161
2268
|
get: operations['getSource'];
|
|
2162
2269
|
put?: never;
|
|
2163
2270
|
post?: never;
|
|
2164
2271
|
/**
|
|
2165
2272
|
* Delete a source
|
|
2166
|
-
* @description
|
|
2273
|
+
* @description Deletes the source immediately. Entries that cite it stay the same until the next build or refresh, which removes the citations and proposes removing any entry left with no sources.
|
|
2167
2274
|
*/
|
|
2168
2275
|
delete: operations['deleteSource'];
|
|
2169
2276
|
options?: never;
|
|
@@ -2179,8 +2286,8 @@ interface paths {
|
|
|
2179
2286
|
cookie?: never;
|
|
2180
2287
|
};
|
|
2181
2288
|
/**
|
|
2182
|
-
*
|
|
2183
|
-
* @description
|
|
2289
|
+
* Get a source's distilled content
|
|
2290
|
+
* @description Returns the source's distilled content: the markdown extracted from the original page, file, or document, which is the text builds cite. Use it to check an issue's claims against the sources listed in its `citedSourceIds`. To fetch a range of lines, set `startLine` and `endLine` (1-indexed, inclusive). The response is JSON by default. Set `format` to `markdown` or `plain` to get the text alone. Until the source finishes processing, the request returns `409` with code `sourceNotDistilled`.
|
|
2184
2291
|
*/
|
|
2185
2292
|
get: operations['getSourceContent'];
|
|
2186
2293
|
put?: never;
|
|
@@ -2201,7 +2308,13 @@ interface paths {
|
|
|
2201
2308
|
get?: never;
|
|
2202
2309
|
/**
|
|
2203
2310
|
* Record a conversation
|
|
2204
|
-
* @description
|
|
2311
|
+
* @description Creates or updates the recorded conversation for one thread. `threadId` identifies the conversation within your organization, so saving with the same `threadId` updates the same conversation. Requires Context Editor access or higher.
|
|
2312
|
+
*
|
|
2313
|
+
* Each save replaces the stored messages. `metadata`, `sharing`, and the model fields change only when you include them. `tokenUsage` is cumulative: send the usage for one generation call, and the API adds it to the conversation total. Usage is added only when the save changes the messages, so retries don't count it twice.
|
|
2314
|
+
*
|
|
2315
|
+
* To report a failure, set `error` on the message where it happened: the tool result for a failed tool call, or the assistant message for a turn that failed instead of answering. The Insights dashboard highlights conversations with a failed turn and counts failed tool calls separately, because agents often recover from them.
|
|
2316
|
+
*
|
|
2317
|
+
* The last write for a thread wins, so retries are safe. `sharing` records whether you share telemetry with Sanity: metrics only, or full transcripts.
|
|
2205
2318
|
*/
|
|
2206
2319
|
put: operations['saveConversation'];
|
|
2207
2320
|
post?: never;
|
|
@@ -2209,8 +2322,13 @@ interface paths {
|
|
|
2209
2322
|
options?: never;
|
|
2210
2323
|
head?: never;
|
|
2211
2324
|
/**
|
|
2212
|
-
* Record a classification
|
|
2213
|
-
* @description Records the classification your own model produced for one thread
|
|
2325
|
+
* Record a conversation classification
|
|
2326
|
+
* @description Records the classification your own model produced for one thread. Send exactly one of these fields:
|
|
2327
|
+
*
|
|
2328
|
+
* - `coreMetrics`: the classification result. The API sets `classifiedAt` and clears any recorded failure.
|
|
2329
|
+
* - `classificationError`: why classification failed. Any earlier result stays unchanged.
|
|
2330
|
+
*
|
|
2331
|
+
* Requires the same access as recording a conversation. The last write wins, so a new classification replaces the previous one.
|
|
2214
2332
|
*/
|
|
2215
2333
|
patch: operations['classifyConversation'];
|
|
2216
2334
|
trace?: never;
|
|
@@ -2218,84 +2336,162 @@ interface paths {
|
|
|
2218
2336
|
}
|
|
2219
2337
|
interface components {
|
|
2220
2338
|
schemas: {
|
|
2221
|
-
/** @description A `sanity.context.conversation` document
|
|
2339
|
+
/** @description A `sanity.context.conversation` document: one agent conversation and its classification, stored in your organization's document store. No endpoint returns this document. Use this schema to type GROQ query results. To record conversations, use the conversations endpoints. */
|
|
2222
2340
|
ConversationDoc: {
|
|
2341
|
+
/** @description The document ID. */
|
|
2223
2342
|
_id: string;
|
|
2343
|
+
/** @description The document revision. It changes on every write. */
|
|
2224
2344
|
_rev: string;
|
|
2225
|
-
/**
|
|
2345
|
+
/**
|
|
2346
|
+
* Format: date-time
|
|
2347
|
+
* @description When the document was created, as an ISO 8601 timestamp.
|
|
2348
|
+
*/
|
|
2226
2349
|
_createdAt: string;
|
|
2227
|
-
/**
|
|
2350
|
+
/**
|
|
2351
|
+
* Format: date-time
|
|
2352
|
+
* @description When the document was last changed, as an ISO 8601 timestamp.
|
|
2353
|
+
*/
|
|
2228
2354
|
_updatedAt: string;
|
|
2229
|
-
/**
|
|
2355
|
+
/**
|
|
2356
|
+
* @description The document type. Always `sanity.context.conversation`.
|
|
2357
|
+
* @enum {string}
|
|
2358
|
+
*/
|
|
2230
2359
|
_type: 'sanity.context.conversation';
|
|
2231
|
-
/**
|
|
2360
|
+
/**
|
|
2361
|
+
* @description The version of the document shape. Currently `1`.
|
|
2362
|
+
* @enum {number}
|
|
2363
|
+
*/
|
|
2232
2364
|
schemaVersion: 1;
|
|
2365
|
+
/** @description The ID of the organization that owns the conversation. Filter on it in every query, because the document store also holds documents from other features. */
|
|
2233
2366
|
organizationId: string;
|
|
2367
|
+
/** @description Your identifier for the conversation thread, unique within the organization. It is the `threadId` in the conversations endpoint path and determines the document `_id`. */
|
|
2234
2368
|
threadId: string;
|
|
2235
|
-
/** @description
|
|
2369
|
+
/** @description Tags that describe the conversation, such as `mcpEndpoints`, `app`, and `environment`. Filter on them in GROQ queries. `null` until a save includes `metadata`. */
|
|
2236
2370
|
metadata: {
|
|
2237
2371
|
[key: string]: string | string[];
|
|
2238
2372
|
} | null;
|
|
2239
|
-
/**
|
|
2373
|
+
/**
|
|
2374
|
+
* Format: date-time
|
|
2375
|
+
* @description When the API received the first save for this thread, as an ISO 8601 timestamp.
|
|
2376
|
+
*/
|
|
2240
2377
|
startedAt: string;
|
|
2241
|
-
/**
|
|
2378
|
+
/**
|
|
2379
|
+
* Format: date-time
|
|
2380
|
+
* @description When the conversation was last saved, as an ISO 8601 timestamp.
|
|
2381
|
+
*/
|
|
2242
2382
|
messagesUpdatedAt: string;
|
|
2383
|
+
/** @description The conversation transcript, in order. Each save replaces it. */
|
|
2243
2384
|
messages: {
|
|
2244
|
-
/**
|
|
2385
|
+
/**
|
|
2386
|
+
* @description Who sent the message. `user` is the person talking to the agent, `assistant` is the agent, `system` is a system prompt, and `tool` is a tool call or tool result.
|
|
2387
|
+
* @enum {string}
|
|
2388
|
+
*/
|
|
2245
2389
|
role: 'user' | 'assistant' | 'system' | 'tool';
|
|
2246
|
-
/**
|
|
2390
|
+
/**
|
|
2391
|
+
* @description The message text. `null` when the message has no text, such as a tool call.
|
|
2392
|
+
* @default null
|
|
2393
|
+
*/
|
|
2247
2394
|
content: string | null;
|
|
2248
|
-
/**
|
|
2395
|
+
/**
|
|
2396
|
+
* @description The name of the tool for a `tool` message. `null` on other messages.
|
|
2397
|
+
* @default null
|
|
2398
|
+
*/
|
|
2249
2399
|
toolName: string | null;
|
|
2250
2400
|
/**
|
|
2401
|
+
* @description The kind of `tool` message. `call` is the agent calling the tool, and `result` is what the tool returned. `null` on other messages.
|
|
2251
2402
|
* @default null
|
|
2252
2403
|
* @enum {string|null}
|
|
2253
2404
|
*/
|
|
2254
2405
|
toolType: 'call' | 'result' | null;
|
|
2406
|
+
/**
|
|
2407
|
+
* @description Why this step failed, including any stack trace. Set it on the tool result for a failed tool call, or on the assistant message for a turn that failed instead of answering. `null` when the step succeeded.
|
|
2408
|
+
* @default null
|
|
2409
|
+
*/
|
|
2410
|
+
error: string | null;
|
|
2411
|
+
/**
|
|
2412
|
+
* Format: date-time
|
|
2413
|
+
* @description When the API first received this message, as an ISO 8601 timestamp. The API sets it. Resending an unchanged message at the same position keeps its timestamp. `null` for messages recorded before timestamps existed.
|
|
2414
|
+
* @default null
|
|
2415
|
+
*/
|
|
2416
|
+
timestamp: string | null;
|
|
2255
2417
|
}[];
|
|
2418
|
+
/** @description The provider of the model the agent used. `null` until a save includes `modelProvider`. */
|
|
2256
2419
|
modelProvider: string | null;
|
|
2420
|
+
/** @description The ID of the model the agent used. `null` until a save includes `modelId`. */
|
|
2257
2421
|
modelId: string | null;
|
|
2258
|
-
/** @description
|
|
2422
|
+
/** @description The running total of token usage for the conversation. `null` until a save includes `tokenUsage`. */
|
|
2259
2423
|
tokenUsage: {
|
|
2424
|
+
/** @description The number of input tokens. */
|
|
2260
2425
|
inputTokens?: number;
|
|
2426
|
+
/** @description The number of output tokens. */
|
|
2261
2427
|
outputTokens?: number;
|
|
2428
|
+
/** @description The total number of tokens. */
|
|
2262
2429
|
totalTokens?: number;
|
|
2263
2430
|
} | null;
|
|
2264
|
-
/** @description
|
|
2431
|
+
/** @description The latest classification result. `null` until you record one. */
|
|
2265
2432
|
coreMetrics: {
|
|
2433
|
+
/** @description How well the agent resolved the user's needs, from 1 to 10. */
|
|
2266
2434
|
successScore?: number;
|
|
2267
|
-
/**
|
|
2435
|
+
/**
|
|
2436
|
+
* @description The overall sentiment of the conversation.
|
|
2437
|
+
* @enum {string}
|
|
2438
|
+
*/
|
|
2268
2439
|
sentiment?: 'positive' | 'neutral' | 'negative';
|
|
2440
|
+
/** @description Topics the agent couldn't answer because it lacked content. */
|
|
2269
2441
|
contentGaps?: string[];
|
|
2270
2442
|
} | null;
|
|
2271
|
-
/**
|
|
2443
|
+
/**
|
|
2444
|
+
* Format: date-time
|
|
2445
|
+
* @description When the latest classification result was recorded, as an ISO 8601 timestamp. The API sets it. `null` until you record a result.
|
|
2446
|
+
*/
|
|
2272
2447
|
classifiedAt: string | null;
|
|
2448
|
+
/** @description Why your classifier couldn't classify the conversation. `null` when no failure is recorded. Recording a result clears it. */
|
|
2273
2449
|
classificationError: string | null;
|
|
2274
2450
|
/**
|
|
2275
|
-
* @description
|
|
2451
|
+
* @description Your choice to share conversation telemetry with Sanity. `null` until a save includes `sharing`.
|
|
2276
2452
|
* @default null
|
|
2277
2453
|
*/
|
|
2278
2454
|
sharing: {
|
|
2455
|
+
/** @description Whether to share classification metrics with Sanity: scores, sentiment, content gap counts, message counts and sizes, tool names, and model and token usage. Message content is not included. */
|
|
2279
2456
|
metrics?: boolean;
|
|
2457
|
+
/** @description Whether to share full conversation transcripts with Sanity. When `true`, the API also sets `metrics` to `true`. */
|
|
2280
2458
|
conversations?: boolean;
|
|
2459
|
+
/** @description How the Sanity team can reach you about your agent, such as an email address or a Discord handle. */
|
|
2281
2460
|
contact?: string;
|
|
2282
2461
|
} | null;
|
|
2283
2462
|
};
|
|
2284
|
-
/** @description A `sanity.context.entry` document
|
|
2463
|
+
/** @description A `sanity.context.entry` document: one entry in a knowledge base outline, stored in your organization's document store. No endpoint returns this document. Use this schema to type GROQ query results. */
|
|
2285
2464
|
EntryDoc: {
|
|
2465
|
+
/** @description The document ID. */
|
|
2286
2466
|
_id: string;
|
|
2467
|
+
/** @description The document revision. It changes on every write. */
|
|
2287
2468
|
_rev: string;
|
|
2288
|
-
/**
|
|
2469
|
+
/**
|
|
2470
|
+
* Format: date-time
|
|
2471
|
+
* @description When the document was created, as an ISO 8601 timestamp.
|
|
2472
|
+
*/
|
|
2289
2473
|
_createdAt: string;
|
|
2290
|
-
/**
|
|
2474
|
+
/**
|
|
2475
|
+
* Format: date-time
|
|
2476
|
+
* @description When the document was last changed, as an ISO 8601 timestamp.
|
|
2477
|
+
*/
|
|
2291
2478
|
_updatedAt: string;
|
|
2479
|
+
/** @description The ID (`kb…`) of the knowledge base this document belongs to. */
|
|
2292
2480
|
knowledgeBaseId: string;
|
|
2293
|
-
/**
|
|
2481
|
+
/**
|
|
2482
|
+
* @description The document type. Always `sanity.context.entry`.
|
|
2483
|
+
* @enum {string}
|
|
2484
|
+
*/
|
|
2294
2485
|
_type: 'sanity.context.entry';
|
|
2486
|
+
/** @description The version of the document shape. Currently `1`. */
|
|
2295
2487
|
schemaVersion: number;
|
|
2488
|
+
/** @description The ID of the build that last wrote this entry's content. An unchanged entry keeps its earlier value across builds. */
|
|
2296
2489
|
revisionId: string;
|
|
2490
|
+
/** @description The entry's slash-delimited path, such as `docs/api/webhooks`. Order entries by `path` to get the knowledge base outline. */
|
|
2297
2491
|
path: string;
|
|
2492
|
+
/** @description The entry title. */
|
|
2298
2493
|
title: string;
|
|
2494
|
+
/** @description A summary of the entry. `scope` is what the entry covers, and `excludes` is what it does not cover. `neighbors` lists the paths of related entries. `centrality` is how important the entry is: `core`, `standard`, or `peripheral`. */
|
|
2299
2495
|
tldr?: {
|
|
2300
2496
|
scope: string;
|
|
2301
2497
|
excludes: string;
|
|
@@ -2303,250 +2499,599 @@ interface components {
|
|
|
2303
2499
|
/** @enum {string} */
|
|
2304
2500
|
centrality: 'core' | 'standard' | 'peripheral';
|
|
2305
2501
|
};
|
|
2502
|
+
/** @description The entry content in Markdown, with inline `[N]` citation markers. Absent when the entry has no content of its own, such as a `virtual` entry. */
|
|
2306
2503
|
body?: string;
|
|
2504
|
+
/** @description The H2 and H3 heading titles in `body`. Absent when the entry has no `body`. */
|
|
2307
2505
|
topicHeadings?: string[];
|
|
2506
|
+
/** @description The sources that back this entry, one item per source. */
|
|
2308
2507
|
citations?: {
|
|
2508
|
+
/** @description ID of the cited source. */
|
|
2309
2509
|
sourceId: string;
|
|
2510
|
+
/** @description Which facts in the entry body this source backs, in a short phrase. */
|
|
2310
2511
|
supports?: string;
|
|
2512
|
+
/** @description Line ranges in the source's distilled content that back those facts, with the quoted text. */
|
|
2311
2513
|
spans?: {
|
|
2514
|
+
/** @description First line of the range, counting from 1. Line numbers match `GET .../sources/{sourceId}/content`. */
|
|
2312
2515
|
sourceLineStart: number;
|
|
2516
|
+
/** @description Last line of the range, inclusive. */
|
|
2313
2517
|
sourceLineEnd: number;
|
|
2518
|
+
/** @description The exact text of the line range in the source. */
|
|
2314
2519
|
quote: string;
|
|
2315
2520
|
}[];
|
|
2521
|
+
/** @description The text in the entry body that this citation backs. */
|
|
2316
2522
|
claim?: {
|
|
2523
|
+
/** @description The exact entry text the citation backs. */
|
|
2317
2524
|
exact: string;
|
|
2525
|
+
/** @description Text immediately before `exact`, to tell apart repeated phrases. */
|
|
2318
2526
|
prefix?: string;
|
|
2527
|
+
/** @description Text immediately after `exact`, to tell apart repeated phrases. */
|
|
2319
2528
|
suffix?: string;
|
|
2320
2529
|
};
|
|
2321
2530
|
/** @enum {string} */
|
|
2322
2531
|
groundingState?: 'drifted';
|
|
2532
|
+
/** @description A unique key for this item in the `citations` array. */
|
|
2323
2533
|
_key: string;
|
|
2324
|
-
/**
|
|
2534
|
+
/**
|
|
2535
|
+
* @description The citation type. Always `sanity.context.citation`.
|
|
2536
|
+
* @enum {string}
|
|
2537
|
+
*/
|
|
2325
2538
|
_type: 'sanity.context.citation';
|
|
2539
|
+
/** @description A display name for the cited source. Builds currently set it to the `sourceId`. */
|
|
2326
2540
|
filename: string;
|
|
2327
2541
|
mime?: string;
|
|
2328
2542
|
excerpt?: string;
|
|
2329
2543
|
}[];
|
|
2330
|
-
/**
|
|
2544
|
+
/**
|
|
2545
|
+
* @description The entry state. Builds currently write only two values: `virtual` for an entry that groups child entries and has no `body`, and `filled` for an entry with a written `body`. The other values are reserved.
|
|
2546
|
+
* @enum {string}
|
|
2547
|
+
*/
|
|
2331
2548
|
status: 'virtual' | 'outlined' | 'filled' | 'stale' | 'generation_failed';
|
|
2549
|
+
/** @description When the build that last wrote this entry's content ran, as an ISO 8601 timestamp. */
|
|
2332
2550
|
generatedAt: string;
|
|
2333
2551
|
};
|
|
2334
|
-
/** @description A `sanity.context.instruction` document
|
|
2552
|
+
/** @description A `sanity.context.instruction` document: a standing instruction that steers every build, stored in your organization's document store. No endpoint returns this document. Use this schema to type GROQ query results. To change instructions, use the instructions endpoints. */
|
|
2335
2553
|
InstructionDoc: {
|
|
2554
|
+
/** @description The document ID. */
|
|
2336
2555
|
_id: string;
|
|
2556
|
+
/** @description The document revision. It changes on every write. */
|
|
2337
2557
|
_rev: string;
|
|
2338
|
-
/**
|
|
2558
|
+
/**
|
|
2559
|
+
* Format: date-time
|
|
2560
|
+
* @description When the document was created, as an ISO 8601 timestamp.
|
|
2561
|
+
*/
|
|
2339
2562
|
_createdAt: string;
|
|
2340
|
-
/**
|
|
2563
|
+
/**
|
|
2564
|
+
* Format: date-time
|
|
2565
|
+
* @description When the document was last changed, as an ISO 8601 timestamp.
|
|
2566
|
+
*/
|
|
2341
2567
|
_updatedAt: string;
|
|
2568
|
+
/** @description The ID (`kb…`) of the knowledge base this document belongs to. */
|
|
2342
2569
|
knowledgeBaseId: string;
|
|
2343
|
-
/**
|
|
2570
|
+
/**
|
|
2571
|
+
* @description The document type. Always `sanity.context.instruction`.
|
|
2572
|
+
* @enum {string}
|
|
2573
|
+
*/
|
|
2344
2574
|
_type: 'sanity.context.instruction';
|
|
2345
|
-
/**
|
|
2575
|
+
/**
|
|
2576
|
+
* @description The version of the document shape. Currently `1`. An instruction without the current version doesn't appear in lists and doesn't affect builds.
|
|
2577
|
+
* @enum {number}
|
|
2578
|
+
*/
|
|
2346
2579
|
schemaVersion: 1;
|
|
2580
|
+
/** @description The instruction, in plain language. Builds follow it over the raw sources. */
|
|
2347
2581
|
statement: string;
|
|
2582
|
+
/** @description The sources the instruction is tied to. The instruction affects the entries that cite these sources. The API always sets at least one source. When `null`, the instruction isn't tied to any source and doesn't affect builds. */
|
|
2348
2583
|
scopeSources: {
|
|
2584
|
+
/** @description A unique key for this item in the array. It matches `sourceId`. */
|
|
2349
2585
|
_key: string;
|
|
2586
|
+
/** @description The ID of the source the instruction is tied to. */
|
|
2350
2587
|
sourceId: string;
|
|
2588
|
+
/** @description The source's content hash when the instruction was last checked against it. When the source content changes, the instruction is checked again. */
|
|
2351
2589
|
contentHash: string;
|
|
2352
2590
|
}[] | null;
|
|
2353
|
-
/**
|
|
2591
|
+
/**
|
|
2592
|
+
* @description The instruction state. `active` instructions apply to every build. `archived` instructions don't apply: a source changed and no longer supports the instruction. Editing an archived instruction makes it `active` again.
|
|
2593
|
+
* @enum {string}
|
|
2594
|
+
*/
|
|
2354
2595
|
status: 'active' | 'archived';
|
|
2596
|
+
/** @description When the instruction was archived, as an ISO 8601 timestamp. `null` while `active`. */
|
|
2355
2597
|
archivedAt: string | null;
|
|
2598
|
+
/** @description Why the instruction was archived. `null` while `active`. */
|
|
2356
2599
|
archivedReason: string | null;
|
|
2357
|
-
/**
|
|
2600
|
+
/**
|
|
2601
|
+
* @description Where the instruction came from. `conflict` means it was created when you resolved a conflict issue.
|
|
2602
|
+
* @enum {string}
|
|
2603
|
+
*/
|
|
2358
2604
|
origin: 'conflict';
|
|
2605
|
+
/** @description The `_id` of the conflict issue this instruction resolved. Reopening that issue deletes this instruction. */
|
|
2359
2606
|
sourceIssueId: string;
|
|
2360
2607
|
} | {
|
|
2608
|
+
/** @description The document ID. */
|
|
2361
2609
|
_id: string;
|
|
2610
|
+
/** @description The document revision. It changes on every write. */
|
|
2362
2611
|
_rev: string;
|
|
2363
|
-
/**
|
|
2612
|
+
/**
|
|
2613
|
+
* Format: date-time
|
|
2614
|
+
* @description When the document was created, as an ISO 8601 timestamp.
|
|
2615
|
+
*/
|
|
2364
2616
|
_createdAt: string;
|
|
2365
|
-
/**
|
|
2617
|
+
/**
|
|
2618
|
+
* Format: date-time
|
|
2619
|
+
* @description When the document was last changed, as an ISO 8601 timestamp.
|
|
2620
|
+
*/
|
|
2366
2621
|
_updatedAt: string;
|
|
2622
|
+
/** @description The ID (`kb…`) of the knowledge base this document belongs to. */
|
|
2367
2623
|
knowledgeBaseId: string;
|
|
2368
|
-
/**
|
|
2624
|
+
/**
|
|
2625
|
+
* @description The document type. Always `sanity.context.instruction`.
|
|
2626
|
+
* @enum {string}
|
|
2627
|
+
*/
|
|
2369
2628
|
_type: 'sanity.context.instruction';
|
|
2370
|
-
/**
|
|
2629
|
+
/**
|
|
2630
|
+
* @description The version of the document shape. Currently `1`. An instruction without the current version doesn't appear in lists and doesn't affect builds.
|
|
2631
|
+
* @enum {number}
|
|
2632
|
+
*/
|
|
2371
2633
|
schemaVersion: 1;
|
|
2634
|
+
/** @description The instruction, in plain language. Builds follow it over the raw sources. */
|
|
2372
2635
|
statement: string;
|
|
2636
|
+
/** @description The sources the instruction is tied to. The instruction affects the entries that cite these sources. The API always sets at least one source. When `null`, the instruction isn't tied to any source and doesn't affect builds. */
|
|
2373
2637
|
scopeSources: {
|
|
2638
|
+
/** @description A unique key for this item in the array. It matches `sourceId`. */
|
|
2374
2639
|
_key: string;
|
|
2640
|
+
/** @description The ID of the source the instruction is tied to. */
|
|
2375
2641
|
sourceId: string;
|
|
2642
|
+
/** @description The source's content hash when the instruction was last checked against it. When the source content changes, the instruction is checked again. */
|
|
2376
2643
|
contentHash: string;
|
|
2377
2644
|
}[] | null;
|
|
2378
|
-
/**
|
|
2645
|
+
/**
|
|
2646
|
+
* @description The instruction state. `active` instructions apply to every build. `archived` instructions don't apply: a source changed and no longer supports the instruction. Editing an archived instruction makes it `active` again.
|
|
2647
|
+
* @enum {string}
|
|
2648
|
+
*/
|
|
2379
2649
|
status: 'active' | 'archived';
|
|
2650
|
+
/** @description When the instruction was archived, as an ISO 8601 timestamp. `null` while `active`. */
|
|
2380
2651
|
archivedAt: string | null;
|
|
2652
|
+
/** @description Why the instruction was archived. `null` while `active`. */
|
|
2381
2653
|
archivedReason: string | null;
|
|
2382
|
-
/**
|
|
2654
|
+
/**
|
|
2655
|
+
* @description Where the instruction came from. `human` means it was created directly through the API or the dashboard.
|
|
2656
|
+
* @enum {string}
|
|
2657
|
+
*/
|
|
2383
2658
|
origin: 'human';
|
|
2384
|
-
/**
|
|
2659
|
+
/**
|
|
2660
|
+
* @description Always `null` for a `human` instruction.
|
|
2661
|
+
* @enum {string|null}
|
|
2662
|
+
*/
|
|
2385
2663
|
sourceIssueId: null;
|
|
2386
2664
|
};
|
|
2387
|
-
/** @description A `sanity.context.issue` document
|
|
2665
|
+
/** @description A `sanity.context.issue` document: a build finding waiting for triage, stored in your organization's document store. No endpoint returns this document. Use this schema to type GROQ query results and Sanity Function filters. To change an issue's status, use the issues endpoints. Only a `conflict` issue can have a non-null `resolution`. */
|
|
2388
2666
|
IssueDoc: {
|
|
2667
|
+
/** @description The document ID. */
|
|
2389
2668
|
_id: string;
|
|
2669
|
+
/** @description The document revision. It changes on every write. */
|
|
2390
2670
|
_rev: string;
|
|
2391
|
-
/**
|
|
2671
|
+
/**
|
|
2672
|
+
* Format: date-time
|
|
2673
|
+
* @description When the document was created, as an ISO 8601 timestamp.
|
|
2674
|
+
*/
|
|
2392
2675
|
_createdAt: string;
|
|
2393
|
-
/**
|
|
2676
|
+
/**
|
|
2677
|
+
* Format: date-time
|
|
2678
|
+
* @description When the document was last changed, as an ISO 8601 timestamp.
|
|
2679
|
+
*/
|
|
2394
2680
|
_updatedAt: string;
|
|
2681
|
+
/** @description The ID (`kb…`) of the knowledge base this document belongs to. */
|
|
2395
2682
|
knowledgeBaseId: string;
|
|
2396
|
-
/**
|
|
2683
|
+
/**
|
|
2684
|
+
* @description The document type. Always `sanity.context.issue`.
|
|
2685
|
+
* @enum {string}
|
|
2686
|
+
*/
|
|
2397
2687
|
_type: 'sanity.context.issue';
|
|
2398
|
-
/**
|
|
2688
|
+
/**
|
|
2689
|
+
* @description The version of the document shape. Currently `1`.
|
|
2690
|
+
* @enum {number}
|
|
2691
|
+
*/
|
|
2399
2692
|
schemaVersion: 1;
|
|
2400
|
-
/** @description
|
|
2693
|
+
/** @description What an issue found. The shape depends on `kind`. */
|
|
2401
2694
|
content: {
|
|
2402
|
-
/**
|
|
2403
|
-
|
|
2404
|
-
|
|
2695
|
+
/**
|
|
2696
|
+
* @description How serious the issue is. `critical`: content is wrong or missing in a way that can mislead an agent. `suggestion`: a change that improves quality.
|
|
2697
|
+
* @enum {string}
|
|
2698
|
+
*/
|
|
2405
2699
|
severity: 'critical' | 'suggestion';
|
|
2700
|
+
/** @description Path of the entry the issue is about, or `*` when it applies to the whole knowledge base. For `add_entry`, the path of the proposed entry. */
|
|
2406
2701
|
scopePath: string;
|
|
2702
|
+
/** @description What the problem is, in one or two sentences. */
|
|
2407
2703
|
issue: string;
|
|
2704
|
+
/** @description What to do to fix the issue. */
|
|
2408
2705
|
suggestedFix: string;
|
|
2706
|
+
/**
|
|
2707
|
+
* @description The issue type. `conflict` means two or more positions disagree on the same fact, and you choose which one is correct.
|
|
2708
|
+
* @enum {string}
|
|
2709
|
+
*/
|
|
2710
|
+
kind: 'conflict';
|
|
2711
|
+
/** @description A key naming the disputed fact, such as `free_tier.request_limit`. It never includes the disputed value, so every side shares it. */
|
|
2712
|
+
claimKey: string;
|
|
2713
|
+
/** @description The conflicting positions, at least two. To resolve the conflict, pass the index of one side as `resolution`. */
|
|
2714
|
+
sides: {
|
|
2715
|
+
/** @description The position as a self-contained sentence. This is the option you choose from. */
|
|
2716
|
+
claim: string;
|
|
2717
|
+
/** @description The disputed value on its own, such as `10,000/month`, without the sentence. */
|
|
2718
|
+
value?: string;
|
|
2719
|
+
/** @description Paths of the entries that state this position. */
|
|
2720
|
+
entryPaths?: string[];
|
|
2721
|
+
/** @description IDs of the sources that directly back this position. */
|
|
2722
|
+
sourceIds?: string[];
|
|
2723
|
+
/** @description Where in a source this position was read. */
|
|
2724
|
+
span?: {
|
|
2725
|
+
/** @description ID of the source the position was read from. */
|
|
2726
|
+
sourceId: string;
|
|
2727
|
+
/** @description First line of the range, counting from 1. Line numbers match `GET .../sources/{sourceId}/content`. */
|
|
2728
|
+
lineStart: number;
|
|
2729
|
+
/** @description Last line of the range, inclusive. */
|
|
2730
|
+
lineEnd: number;
|
|
2731
|
+
};
|
|
2732
|
+
/**
|
|
2733
|
+
* @description How much weight the sources behind this position carry. `primary`: your own content, such as uploaded files and pages on your own site. `secondary`: other sources. `community`: forums and Q&A sites.
|
|
2734
|
+
* @enum {string}
|
|
2735
|
+
*/
|
|
2736
|
+
authority?: 'primary' | 'secondary' | 'community';
|
|
2737
|
+
}[];
|
|
2738
|
+
/** @description Index in `sides` of the suggested side, when there is one. It is only a hint: nothing is chosen until you resolve the issue. */
|
|
2739
|
+
suggested?: number;
|
|
2740
|
+
} | {
|
|
2741
|
+
/**
|
|
2742
|
+
* @description How serious the issue is. `critical`: content is wrong or missing in a way that can mislead an agent. `suggestion`: a change that improves quality.
|
|
2743
|
+
* @enum {string}
|
|
2744
|
+
*/
|
|
2745
|
+
severity: 'critical' | 'suggestion';
|
|
2746
|
+
/** @description Path of the entry the issue is about, or `*` when it applies to the whole knowledge base. For `add_entry`, the path of the proposed entry. */
|
|
2747
|
+
scopePath: string;
|
|
2748
|
+
/** @description What the problem is, in one or two sentences. */
|
|
2749
|
+
issue: string;
|
|
2750
|
+
/** @description What to do to fix the issue. */
|
|
2751
|
+
suggestedFix: string;
|
|
2752
|
+
/**
|
|
2753
|
+
* @description The issue type. `gap`: your sources cover material that entries leave out. `update_required`: an entry is out of date with its sources or contradicts an instruction, and needs a rewrite. `add_entry`: your sources cover a topic that no entry covers. `remove_entry`: an entry has lost its sources or its topic no longer applies. `split_entry`: an entry covers several distinct topics and should become child entries. `merge_entry`: an entry has too few sources to stand alone, so merge it into a nearby entry or keep it as it is.
|
|
2754
|
+
* @enum {string}
|
|
2755
|
+
*/
|
|
2756
|
+
kind: 'gap' | 'update_required' | 'add_entry' | 'remove_entry' | 'split_entry' | 'merge_entry';
|
|
2757
|
+
/** @description IDs of the sources that led to the issue. For `add_entry`, the sources the new entry would cite. */
|
|
2409
2758
|
citedSourceIds?: string[];
|
|
2759
|
+
/** @description A key naming the specific finding, when the check that found it sets one. */
|
|
2410
2760
|
claimKey?: string;
|
|
2761
|
+
/** @description Paths of the entries the issue involves, when it spans more than one entry. */
|
|
2411
2762
|
involvedScopes?: string[];
|
|
2412
|
-
currentClaim?: string;
|
|
2413
|
-
alternativeClaim?: string;
|
|
2414
|
-
/** @enum {string} */
|
|
2415
|
-
currentAuthority?: 'primary' | 'secondary' | 'community';
|
|
2416
|
-
/** @enum {string} */
|
|
2417
|
-
alternativeAuthority?: 'primary' | 'secondary' | 'community';
|
|
2418
|
-
/** @enum {string} */
|
|
2419
|
-
suggestedResolution?: 'keep_existing' | 'accept_new';
|
|
2420
2763
|
};
|
|
2764
|
+
/** @description An identity for the finding that doesn't depend on its wording. It determines the issue's `_id`, so a reworded finding updates the same issue. */
|
|
2421
2765
|
fingerprint: string;
|
|
2766
|
+
/** @description The ID of the build that filed this issue. `null` when the issue was filed outside a build, such as when removing a source leaves an entry without sources. */
|
|
2422
2767
|
revisionId: string | null;
|
|
2423
|
-
/**
|
|
2768
|
+
/**
|
|
2769
|
+
* @description The issue status. `open` means it is waiting for triage.
|
|
2770
|
+
* @enum {string}
|
|
2771
|
+
*/
|
|
2424
2772
|
status: 'open';
|
|
2425
|
-
/**
|
|
2773
|
+
/**
|
|
2774
|
+
* @description Always `null` while the issue is `open`.
|
|
2775
|
+
* @enum {string|null}
|
|
2776
|
+
*/
|
|
2426
2777
|
resolution: null;
|
|
2427
|
-
/**
|
|
2778
|
+
/**
|
|
2779
|
+
* @description Always `null` while the issue is `open`.
|
|
2780
|
+
* @enum {string|null}
|
|
2781
|
+
*/
|
|
2428
2782
|
resolvedAt: null;
|
|
2429
|
-
/**
|
|
2783
|
+
/**
|
|
2784
|
+
* @description Always `null` while the issue is `open`.
|
|
2785
|
+
* @enum {string|null}
|
|
2786
|
+
*/
|
|
2430
2787
|
resolvedBy: null;
|
|
2431
2788
|
} | {
|
|
2789
|
+
/** @description The document ID. */
|
|
2432
2790
|
_id: string;
|
|
2791
|
+
/** @description The document revision. It changes on every write. */
|
|
2433
2792
|
_rev: string;
|
|
2434
|
-
/**
|
|
2793
|
+
/**
|
|
2794
|
+
* Format: date-time
|
|
2795
|
+
* @description When the document was created, as an ISO 8601 timestamp.
|
|
2796
|
+
*/
|
|
2435
2797
|
_createdAt: string;
|
|
2436
|
-
/**
|
|
2798
|
+
/**
|
|
2799
|
+
* Format: date-time
|
|
2800
|
+
* @description When the document was last changed, as an ISO 8601 timestamp.
|
|
2801
|
+
*/
|
|
2437
2802
|
_updatedAt: string;
|
|
2803
|
+
/** @description The ID (`kb…`) of the knowledge base this document belongs to. */
|
|
2438
2804
|
knowledgeBaseId: string;
|
|
2439
|
-
/**
|
|
2805
|
+
/**
|
|
2806
|
+
* @description The document type. Always `sanity.context.issue`.
|
|
2807
|
+
* @enum {string}
|
|
2808
|
+
*/
|
|
2440
2809
|
_type: 'sanity.context.issue';
|
|
2441
|
-
/**
|
|
2810
|
+
/**
|
|
2811
|
+
* @description The version of the document shape. Currently `1`.
|
|
2812
|
+
* @enum {number}
|
|
2813
|
+
*/
|
|
2442
2814
|
schemaVersion: 1;
|
|
2443
|
-
/** @description
|
|
2815
|
+
/** @description What an issue found. The shape depends on `kind`. */
|
|
2444
2816
|
content: {
|
|
2445
|
-
/**
|
|
2446
|
-
|
|
2447
|
-
|
|
2817
|
+
/**
|
|
2818
|
+
* @description How serious the issue is. `critical`: content is wrong or missing in a way that can mislead an agent. `suggestion`: a change that improves quality.
|
|
2819
|
+
* @enum {string}
|
|
2820
|
+
*/
|
|
2448
2821
|
severity: 'critical' | 'suggestion';
|
|
2822
|
+
/** @description Path of the entry the issue is about, or `*` when it applies to the whole knowledge base. For `add_entry`, the path of the proposed entry. */
|
|
2449
2823
|
scopePath: string;
|
|
2824
|
+
/** @description What the problem is, in one or two sentences. */
|
|
2450
2825
|
issue: string;
|
|
2826
|
+
/** @description What to do to fix the issue. */
|
|
2451
2827
|
suggestedFix: string;
|
|
2828
|
+
/**
|
|
2829
|
+
* @description The issue type. `conflict` means two or more positions disagree on the same fact, and you choose which one is correct.
|
|
2830
|
+
* @enum {string}
|
|
2831
|
+
*/
|
|
2832
|
+
kind: 'conflict';
|
|
2833
|
+
/** @description A key naming the disputed fact, such as `free_tier.request_limit`. It never includes the disputed value, so every side shares it. */
|
|
2834
|
+
claimKey: string;
|
|
2835
|
+
/** @description The conflicting positions, at least two. To resolve the conflict, pass the index of one side as `resolution`. */
|
|
2836
|
+
sides: {
|
|
2837
|
+
/** @description The position as a self-contained sentence. This is the option you choose from. */
|
|
2838
|
+
claim: string;
|
|
2839
|
+
/** @description The disputed value on its own, such as `10,000/month`, without the sentence. */
|
|
2840
|
+
value?: string;
|
|
2841
|
+
/** @description Paths of the entries that state this position. */
|
|
2842
|
+
entryPaths?: string[];
|
|
2843
|
+
/** @description IDs of the sources that directly back this position. */
|
|
2844
|
+
sourceIds?: string[];
|
|
2845
|
+
/** @description Where in a source this position was read. */
|
|
2846
|
+
span?: {
|
|
2847
|
+
/** @description ID of the source the position was read from. */
|
|
2848
|
+
sourceId: string;
|
|
2849
|
+
/** @description First line of the range, counting from 1. Line numbers match `GET .../sources/{sourceId}/content`. */
|
|
2850
|
+
lineStart: number;
|
|
2851
|
+
/** @description Last line of the range, inclusive. */
|
|
2852
|
+
lineEnd: number;
|
|
2853
|
+
};
|
|
2854
|
+
/**
|
|
2855
|
+
* @description How much weight the sources behind this position carry. `primary`: your own content, such as uploaded files and pages on your own site. `secondary`: other sources. `community`: forums and Q&A sites.
|
|
2856
|
+
* @enum {string}
|
|
2857
|
+
*/
|
|
2858
|
+
authority?: 'primary' | 'secondary' | 'community';
|
|
2859
|
+
}[];
|
|
2860
|
+
/** @description Index in `sides` of the suggested side, when there is one. It is only a hint: nothing is chosen until you resolve the issue. */
|
|
2861
|
+
suggested?: number;
|
|
2862
|
+
} | {
|
|
2863
|
+
/**
|
|
2864
|
+
* @description How serious the issue is. `critical`: content is wrong or missing in a way that can mislead an agent. `suggestion`: a change that improves quality.
|
|
2865
|
+
* @enum {string}
|
|
2866
|
+
*/
|
|
2867
|
+
severity: 'critical' | 'suggestion';
|
|
2868
|
+
/** @description Path of the entry the issue is about, or `*` when it applies to the whole knowledge base. For `add_entry`, the path of the proposed entry. */
|
|
2869
|
+
scopePath: string;
|
|
2870
|
+
/** @description What the problem is, in one or two sentences. */
|
|
2871
|
+
issue: string;
|
|
2872
|
+
/** @description What to do to fix the issue. */
|
|
2873
|
+
suggestedFix: string;
|
|
2874
|
+
/**
|
|
2875
|
+
* @description The issue type. `gap`: your sources cover material that entries leave out. `update_required`: an entry is out of date with its sources or contradicts an instruction, and needs a rewrite. `add_entry`: your sources cover a topic that no entry covers. `remove_entry`: an entry has lost its sources or its topic no longer applies. `split_entry`: an entry covers several distinct topics and should become child entries. `merge_entry`: an entry has too few sources to stand alone, so merge it into a nearby entry or keep it as it is.
|
|
2876
|
+
* @enum {string}
|
|
2877
|
+
*/
|
|
2878
|
+
kind: 'gap' | 'update_required' | 'add_entry' | 'remove_entry' | 'split_entry' | 'merge_entry';
|
|
2879
|
+
/** @description IDs of the sources that led to the issue. For `add_entry`, the sources the new entry would cite. */
|
|
2452
2880
|
citedSourceIds?: string[];
|
|
2881
|
+
/** @description A key naming the specific finding, when the check that found it sets one. */
|
|
2453
2882
|
claimKey?: string;
|
|
2883
|
+
/** @description Paths of the entries the issue involves, when it spans more than one entry. */
|
|
2454
2884
|
involvedScopes?: string[];
|
|
2455
|
-
currentClaim?: string;
|
|
2456
|
-
alternativeClaim?: string;
|
|
2457
|
-
/** @enum {string} */
|
|
2458
|
-
currentAuthority?: 'primary' | 'secondary' | 'community';
|
|
2459
|
-
/** @enum {string} */
|
|
2460
|
-
alternativeAuthority?: 'primary' | 'secondary' | 'community';
|
|
2461
|
-
/** @enum {string} */
|
|
2462
|
-
suggestedResolution?: 'keep_existing' | 'accept_new';
|
|
2463
2885
|
};
|
|
2886
|
+
/** @description An identity for the finding that doesn't depend on its wording. It determines the issue's `_id`, so a reworded finding updates the same issue. */
|
|
2464
2887
|
fingerprint: string;
|
|
2888
|
+
/** @description The ID of the build that filed this issue. `null` when the issue was filed outside a build, such as when removing a source leaves an entry without sources. */
|
|
2465
2889
|
revisionId: string | null;
|
|
2466
|
-
/**
|
|
2890
|
+
/**
|
|
2891
|
+
* @description The issue status. `accepted` means the issue was resolved or its fix applied.
|
|
2892
|
+
* @enum {string}
|
|
2893
|
+
*/
|
|
2467
2894
|
status: 'accepted';
|
|
2468
|
-
/**
|
|
2895
|
+
/**
|
|
2896
|
+
* Format: date-time
|
|
2897
|
+
* @description When the issue left `open`, as an ISO 8601 timestamp.
|
|
2898
|
+
*/
|
|
2469
2899
|
resolvedAt: string;
|
|
2900
|
+
/** @description Who triaged the issue. `null` while the issue is open, or when the caller could not be identified. */
|
|
2470
2901
|
resolvedBy: {
|
|
2902
|
+
/** @description The ID of the Sanity user or robot token that triaged the issue. */
|
|
2471
2903
|
id: string;
|
|
2472
|
-
/**
|
|
2904
|
+
/**
|
|
2905
|
+
* @description What triaged the issue. `user` is a person, and `robot` is a robot token.
|
|
2906
|
+
* @enum {string}
|
|
2907
|
+
*/
|
|
2473
2908
|
kind: 'user' | 'robot';
|
|
2474
2909
|
} | null;
|
|
2475
|
-
/** @
|
|
2476
|
-
resolution:
|
|
2910
|
+
/** @description The index of the chosen side in `content.sides`. For a conflict on one entry, index `0` is the entry's own position. `null` when the fix was applied without choosing a side. */
|
|
2911
|
+
resolution: number | null;
|
|
2477
2912
|
} | {
|
|
2913
|
+
/** @description The document ID. */
|
|
2478
2914
|
_id: string;
|
|
2915
|
+
/** @description The document revision. It changes on every write. */
|
|
2479
2916
|
_rev: string;
|
|
2480
|
-
/**
|
|
2917
|
+
/**
|
|
2918
|
+
* Format: date-time
|
|
2919
|
+
* @description When the document was created, as an ISO 8601 timestamp.
|
|
2920
|
+
*/
|
|
2481
2921
|
_createdAt: string;
|
|
2482
|
-
/**
|
|
2922
|
+
/**
|
|
2923
|
+
* Format: date-time
|
|
2924
|
+
* @description When the document was last changed, as an ISO 8601 timestamp.
|
|
2925
|
+
*/
|
|
2483
2926
|
_updatedAt: string;
|
|
2927
|
+
/** @description The ID (`kb…`) of the knowledge base this document belongs to. */
|
|
2484
2928
|
knowledgeBaseId: string;
|
|
2485
|
-
/**
|
|
2929
|
+
/**
|
|
2930
|
+
* @description The document type. Always `sanity.context.issue`.
|
|
2931
|
+
* @enum {string}
|
|
2932
|
+
*/
|
|
2486
2933
|
_type: 'sanity.context.issue';
|
|
2487
|
-
/**
|
|
2934
|
+
/**
|
|
2935
|
+
* @description The version of the document shape. Currently `1`.
|
|
2936
|
+
* @enum {number}
|
|
2937
|
+
*/
|
|
2488
2938
|
schemaVersion: 1;
|
|
2489
|
-
/** @description
|
|
2939
|
+
/** @description What an issue found. The shape depends on `kind`. */
|
|
2490
2940
|
content: {
|
|
2491
|
-
/**
|
|
2492
|
-
|
|
2493
|
-
|
|
2941
|
+
/**
|
|
2942
|
+
* @description How serious the issue is. `critical`: content is wrong or missing in a way that can mislead an agent. `suggestion`: a change that improves quality.
|
|
2943
|
+
* @enum {string}
|
|
2944
|
+
*/
|
|
2494
2945
|
severity: 'critical' | 'suggestion';
|
|
2946
|
+
/** @description Path of the entry the issue is about, or `*` when it applies to the whole knowledge base. For `add_entry`, the path of the proposed entry. */
|
|
2495
2947
|
scopePath: string;
|
|
2948
|
+
/** @description What the problem is, in one or two sentences. */
|
|
2496
2949
|
issue: string;
|
|
2950
|
+
/** @description What to do to fix the issue. */
|
|
2497
2951
|
suggestedFix: string;
|
|
2952
|
+
/**
|
|
2953
|
+
* @description The issue type. `conflict` means two or more positions disagree on the same fact, and you choose which one is correct.
|
|
2954
|
+
* @enum {string}
|
|
2955
|
+
*/
|
|
2956
|
+
kind: 'conflict';
|
|
2957
|
+
/** @description A key naming the disputed fact, such as `free_tier.request_limit`. It never includes the disputed value, so every side shares it. */
|
|
2958
|
+
claimKey: string;
|
|
2959
|
+
/** @description The conflicting positions, at least two. To resolve the conflict, pass the index of one side as `resolution`. */
|
|
2960
|
+
sides: {
|
|
2961
|
+
/** @description The position as a self-contained sentence. This is the option you choose from. */
|
|
2962
|
+
claim: string;
|
|
2963
|
+
/** @description The disputed value on its own, such as `10,000/month`, without the sentence. */
|
|
2964
|
+
value?: string;
|
|
2965
|
+
/** @description Paths of the entries that state this position. */
|
|
2966
|
+
entryPaths?: string[];
|
|
2967
|
+
/** @description IDs of the sources that directly back this position. */
|
|
2968
|
+
sourceIds?: string[];
|
|
2969
|
+
/** @description Where in a source this position was read. */
|
|
2970
|
+
span?: {
|
|
2971
|
+
/** @description ID of the source the position was read from. */
|
|
2972
|
+
sourceId: string;
|
|
2973
|
+
/** @description First line of the range, counting from 1. Line numbers match `GET .../sources/{sourceId}/content`. */
|
|
2974
|
+
lineStart: number;
|
|
2975
|
+
/** @description Last line of the range, inclusive. */
|
|
2976
|
+
lineEnd: number;
|
|
2977
|
+
};
|
|
2978
|
+
/**
|
|
2979
|
+
* @description How much weight the sources behind this position carry. `primary`: your own content, such as uploaded files and pages on your own site. `secondary`: other sources. `community`: forums and Q&A sites.
|
|
2980
|
+
* @enum {string}
|
|
2981
|
+
*/
|
|
2982
|
+
authority?: 'primary' | 'secondary' | 'community';
|
|
2983
|
+
}[];
|
|
2984
|
+
/** @description Index in `sides` of the suggested side, when there is one. It is only a hint: nothing is chosen until you resolve the issue. */
|
|
2985
|
+
suggested?: number;
|
|
2986
|
+
} | {
|
|
2987
|
+
/**
|
|
2988
|
+
* @description How serious the issue is. `critical`: content is wrong or missing in a way that can mislead an agent. `suggestion`: a change that improves quality.
|
|
2989
|
+
* @enum {string}
|
|
2990
|
+
*/
|
|
2991
|
+
severity: 'critical' | 'suggestion';
|
|
2992
|
+
/** @description Path of the entry the issue is about, or `*` when it applies to the whole knowledge base. For `add_entry`, the path of the proposed entry. */
|
|
2993
|
+
scopePath: string;
|
|
2994
|
+
/** @description What the problem is, in one or two sentences. */
|
|
2995
|
+
issue: string;
|
|
2996
|
+
/** @description What to do to fix the issue. */
|
|
2997
|
+
suggestedFix: string;
|
|
2998
|
+
/**
|
|
2999
|
+
* @description The issue type. `gap`: your sources cover material that entries leave out. `update_required`: an entry is out of date with its sources or contradicts an instruction, and needs a rewrite. `add_entry`: your sources cover a topic that no entry covers. `remove_entry`: an entry has lost its sources or its topic no longer applies. `split_entry`: an entry covers several distinct topics and should become child entries. `merge_entry`: an entry has too few sources to stand alone, so merge it into a nearby entry or keep it as it is.
|
|
3000
|
+
* @enum {string}
|
|
3001
|
+
*/
|
|
3002
|
+
kind: 'gap' | 'update_required' | 'add_entry' | 'remove_entry' | 'split_entry' | 'merge_entry';
|
|
3003
|
+
/** @description IDs of the sources that led to the issue. For `add_entry`, the sources the new entry would cite. */
|
|
2498
3004
|
citedSourceIds?: string[];
|
|
3005
|
+
/** @description A key naming the specific finding, when the check that found it sets one. */
|
|
2499
3006
|
claimKey?: string;
|
|
3007
|
+
/** @description Paths of the entries the issue involves, when it spans more than one entry. */
|
|
2500
3008
|
involvedScopes?: string[];
|
|
2501
|
-
currentClaim?: string;
|
|
2502
|
-
alternativeClaim?: string;
|
|
2503
|
-
/** @enum {string} */
|
|
2504
|
-
currentAuthority?: 'primary' | 'secondary' | 'community';
|
|
2505
|
-
/** @enum {string} */
|
|
2506
|
-
alternativeAuthority?: 'primary' | 'secondary' | 'community';
|
|
2507
|
-
/** @enum {string} */
|
|
2508
|
-
suggestedResolution?: 'keep_existing' | 'accept_new';
|
|
2509
3009
|
};
|
|
3010
|
+
/** @description An identity for the finding that doesn't depend on its wording. It determines the issue's `_id`, so a reworded finding updates the same issue. */
|
|
2510
3011
|
fingerprint: string;
|
|
3012
|
+
/** @description The ID of the build that filed this issue. `null` when the issue was filed outside a build, such as when removing a source leaves an entry without sources. */
|
|
2511
3013
|
revisionId: string | null;
|
|
2512
|
-
/**
|
|
3014
|
+
/**
|
|
3015
|
+
* @description The issue status. `rejected` means the issue was dismissed. Dismissal is final.
|
|
3016
|
+
* @enum {string}
|
|
3017
|
+
*/
|
|
2513
3018
|
status: 'rejected';
|
|
2514
|
-
/**
|
|
3019
|
+
/**
|
|
3020
|
+
* Format: date-time
|
|
3021
|
+
* @description When the issue left `open`, as an ISO 8601 timestamp.
|
|
3022
|
+
*/
|
|
2515
3023
|
resolvedAt: string;
|
|
3024
|
+
/** @description Who triaged the issue. `null` while the issue is open, or when the caller could not be identified. */
|
|
2516
3025
|
resolvedBy: {
|
|
3026
|
+
/** @description The ID of the Sanity user or robot token that triaged the issue. */
|
|
2517
3027
|
id: string;
|
|
2518
|
-
/**
|
|
3028
|
+
/**
|
|
3029
|
+
* @description What triaged the issue. `user` is a person, and `robot` is a robot token.
|
|
3030
|
+
* @enum {string}
|
|
3031
|
+
*/
|
|
2519
3032
|
kind: 'user' | 'robot';
|
|
2520
3033
|
} | null;
|
|
2521
|
-
/**
|
|
3034
|
+
/**
|
|
3035
|
+
* @description Always `null`, because a dismissal chooses no side.
|
|
3036
|
+
* @enum {string|null}
|
|
3037
|
+
*/
|
|
2522
3038
|
resolution: null;
|
|
2523
3039
|
};
|
|
2524
|
-
/** @description A `sanity.context.mcp` document
|
|
3040
|
+
/** @description A `sanity.context.mcp` document: the configuration of one MCP endpoint, stored in your organization's document store. No endpoint returns this document. Use this schema to type GROQ query results and Sanity Function filters. Manage MCP endpoints in the Context dashboard. */
|
|
2525
3041
|
McpDoc: {
|
|
3042
|
+
/** @description The document ID. */
|
|
2526
3043
|
_id: string;
|
|
3044
|
+
/** @description The document revision. It changes on every write. */
|
|
2527
3045
|
_rev: string;
|
|
2528
|
-
/**
|
|
3046
|
+
/**
|
|
3047
|
+
* Format: date-time
|
|
3048
|
+
* @description When the document was created, as an ISO 8601 timestamp.
|
|
3049
|
+
*/
|
|
2529
3050
|
_createdAt: string;
|
|
2530
|
-
/**
|
|
3051
|
+
/**
|
|
3052
|
+
* Format: date-time
|
|
3053
|
+
* @description When the document was last changed, as an ISO 8601 timestamp.
|
|
3054
|
+
*/
|
|
2531
3055
|
_updatedAt: string;
|
|
2532
|
-
/**
|
|
3056
|
+
/**
|
|
3057
|
+
* @description The document type. Always `sanity.context.mcp`.
|
|
3058
|
+
* @enum {string}
|
|
3059
|
+
*/
|
|
2533
3060
|
_type: 'sanity.context.mcp';
|
|
2534
|
-
/**
|
|
3061
|
+
/**
|
|
3062
|
+
* @description The version of the document shape. Currently `1`.
|
|
3063
|
+
* @enum {number}
|
|
3064
|
+
*/
|
|
2535
3065
|
schemaVersion: 1;
|
|
3066
|
+
/** @description The ID of the organization that owns the MCP endpoint. Filter on it in every query, because the document store also holds documents from other features. */
|
|
2536
3067
|
organizationId: string;
|
|
3068
|
+
/** @description The MCP endpoint's public ID (`mcp…`). It is set once at creation, never changes, and determines the document `_id`. */
|
|
2537
3069
|
publicId: string;
|
|
3070
|
+
/** @description The MCP endpoint's display name. You can change it at any time. */
|
|
2538
3071
|
title: string;
|
|
3072
|
+
/** @description The MCP endpoint's name in its URL, in lowercase kebab case such as `my-endpoint`. It is unique within the organization and can't change after creation. */
|
|
2539
3073
|
name: string;
|
|
3074
|
+
/** @description The content sources the MCP endpoint serves. Each source appears once, and the order has no meaning. */
|
|
2540
3075
|
sources: ({
|
|
2541
|
-
/**
|
|
3076
|
+
/**
|
|
3077
|
+
* @description The source type. `knowledge-base` serves a whole knowledge base.
|
|
3078
|
+
* @enum {string}
|
|
3079
|
+
*/
|
|
2542
3080
|
type: 'knowledge-base';
|
|
3081
|
+
/** @description The knowledge base ID (`kb…`). */
|
|
2543
3082
|
id: string;
|
|
2544
3083
|
} | {
|
|
2545
|
-
/**
|
|
3084
|
+
/**
|
|
3085
|
+
* @description The source type. `dataset` serves documents from a Sanity dataset, limited by the MCP endpoint's `groqFilter` when set.
|
|
3086
|
+
* @enum {string}
|
|
3087
|
+
*/
|
|
2546
3088
|
type: 'dataset';
|
|
3089
|
+
/** @description The dataset, as `<projectId>.<datasetName>`. */
|
|
2547
3090
|
id: string;
|
|
2548
3091
|
})[];
|
|
3092
|
+
/** @description Prompt text the MCP endpoint serves to connecting agents. `null` when unset. */
|
|
2549
3093
|
instructions: string | null;
|
|
3094
|
+
/** @description A GROQ filter that limits what the MCP endpoint's `dataset` sources serve. It has no effect on `knowledge-base` sources. `null` when unset. */
|
|
2550
3095
|
groqFilter: string | null;
|
|
2551
3096
|
};
|
|
2552
3097
|
};
|
|
@@ -2560,8 +3105,11 @@ interface operations {
|
|
|
2560
3105
|
listKnowledgeBases: {
|
|
2561
3106
|
parameters: {
|
|
2562
3107
|
query: {
|
|
3108
|
+
/** @description The `nextCursor` value from the previous page. Omit it to get the first page. */
|
|
2563
3109
|
cursor?: string;
|
|
3110
|
+
/** @description The maximum number of items to return. */
|
|
2564
3111
|
limit?: number;
|
|
3112
|
+
/** @description The organization to list knowledge bases for. */
|
|
2565
3113
|
organizationId: string;
|
|
2566
3114
|
};
|
|
2567
3115
|
header?: never;
|
|
@@ -2572,79 +3120,155 @@ interface operations {
|
|
|
2572
3120
|
};
|
|
2573
3121
|
requestBody?: never;
|
|
2574
3122
|
responses: {
|
|
2575
|
-
/** @description
|
|
3123
|
+
/** @description A page of knowledge bases. */
|
|
2576
3124
|
200: {
|
|
2577
3125
|
headers: {
|
|
2578
3126
|
[name: string]: unknown;
|
|
2579
3127
|
};
|
|
2580
3128
|
content: {
|
|
2581
3129
|
'application/json': {
|
|
3130
|
+
/** @description The items on this page. */
|
|
2582
3131
|
data: {
|
|
2583
|
-
/**
|
|
3132
|
+
/**
|
|
3133
|
+
* Format: uuid
|
|
3134
|
+
* @description The knowledge base's unique ID, a UUID. Accepted anywhere a `knowledgeBaseId` is expected.
|
|
3135
|
+
*/
|
|
2584
3136
|
id: string;
|
|
3137
|
+
/** @description The knowledge base ID to show users, such as `kb3do82whm`. Accepted anywhere a `knowledgeBaseId` is expected. Treat it as an opaque string. */
|
|
2585
3138
|
publicId: string;
|
|
3139
|
+
/** @description The ID of the organization that owns the knowledge base. */
|
|
2586
3140
|
organizationId: string;
|
|
3141
|
+
/** @description The knowledge base's title. */
|
|
2587
3142
|
title: string;
|
|
3143
|
+
/** @description A short description of what the knowledge base covers. */
|
|
2588
3144
|
description: string;
|
|
2589
|
-
/**
|
|
3145
|
+
/**
|
|
3146
|
+
* @description The knowledge base's build state. `created`: not built yet. `ready`: built, with no open issues. `review`: built, with open issues to review. A failed build doesn't change the state. `building`, `stale`, and `paused` aren't currently returned. To check for a running build, use `isBuilding`.
|
|
3147
|
+
* @enum {string}
|
|
3148
|
+
*/
|
|
2590
3149
|
state: 'created' | 'building' | 'ready' | 'review' | 'stale' | 'paused';
|
|
3150
|
+
/** @description The job ID of the most recent build, or `null` if no build has started. Check its progress with `GET .../jobs/{jobId}`. */
|
|
2591
3151
|
activeJobId: string | null;
|
|
3152
|
+
/** @description Whether a build is running now. */
|
|
2592
3153
|
isBuilding: boolean;
|
|
3154
|
+
/** @description Progress of the most recent build, by stage. `null` until a build reports progress. It can briefly belong to an earlier build, so use it only when its `jobId` matches `activeJobId`. */
|
|
2593
3155
|
buildStageState: {
|
|
3156
|
+
/** @description The ID of the build job this progress belongs to. */
|
|
2594
3157
|
jobId: string;
|
|
3158
|
+
/** @description The build's stages and their progress. Stages that haven't reported yet can be missing. */
|
|
2595
3159
|
stages: {
|
|
2596
|
-
/**
|
|
3160
|
+
/**
|
|
3161
|
+
* @description The stage's ID. The values are listed in the order stages run.
|
|
3162
|
+
* @enum {string}
|
|
3163
|
+
*/
|
|
2597
3164
|
id: 'tldr' | 'map' | 'triage' | 'plan' | 'organize' | 'arrange' | 'write' | 'review' | 'polish';
|
|
2598
|
-
/**
|
|
3165
|
+
/**
|
|
3166
|
+
* @description The stage's status. `pending`: not started. `running`: in progress. `done`: finished. `failed`: the build ended before the stage finished.
|
|
3167
|
+
* @enum {string}
|
|
3168
|
+
*/
|
|
2599
3169
|
status: 'pending' | 'running' | 'done' | 'failed';
|
|
3170
|
+
/** @description The stage's progress counts. Absent when the stage hasn't reported counts. */
|
|
2600
3171
|
units?: {
|
|
2601
|
-
/**
|
|
3172
|
+
/**
|
|
3173
|
+
* @description What `done` and `total` count: `sources`, `groups` of related content, `entries`, or `rounds` of final fixes. A `rounds` stage has no `total`.
|
|
3174
|
+
* @enum {string}
|
|
3175
|
+
*/
|
|
2602
3176
|
unit: 'sources' | 'groups' | 'entries' | 'rounds';
|
|
3177
|
+
/** @description How many units the stage has finished. */
|
|
2603
3178
|
done: number;
|
|
3179
|
+
/** @description How many units the stage will process. Absent when `unit` is `rounds`. */
|
|
2604
3180
|
total?: number;
|
|
2605
3181
|
};
|
|
2606
3182
|
}[];
|
|
2607
3183
|
} | null;
|
|
2608
|
-
/**
|
|
3184
|
+
/**
|
|
3185
|
+
* Format: date-time
|
|
3186
|
+
* @description When a refresh last checked the knowledge base for changes, whether or not anything changed. `null` until the first refresh.
|
|
3187
|
+
*/
|
|
2609
3188
|
lastCheckedAt: string | null;
|
|
2610
|
-
/**
|
|
3189
|
+
/**
|
|
3190
|
+
* Format: date-time
|
|
3191
|
+
* @description When the content last changed: the time of the most recent successful build. `null` if the knowledge base has never built.
|
|
3192
|
+
*/
|
|
2611
3193
|
lastChangedAt: string | null;
|
|
3194
|
+
/** @description Whether sources were added, changed, or removed since the last successful build. Always `false` before the first build. */
|
|
2612
3195
|
hasPendingChanges: boolean;
|
|
3196
|
+
/** @description Counts of sources added, changed, and removed since the last successful build. Only `GET .../knowledge-bases/{knowledgeBaseId}` computes it. `null` in list responses and before the first build. */
|
|
2613
3197
|
pendingChanges: {
|
|
3198
|
+
/** @description Sources added since the last successful build, including sources no successful build has included yet. */
|
|
2614
3199
|
added: number;
|
|
3200
|
+
/** @description Sources whose content changed since the last successful build. */
|
|
2615
3201
|
changed: number;
|
|
3202
|
+
/** @description Sources that recent refreshes no longer find. */
|
|
2616
3203
|
removed: number;
|
|
2617
3204
|
} | null;
|
|
3205
|
+
/** @description Whether Sanity Context has improved how it builds knowledge bases since the last successful build. Rebuild to apply the improvements. Always `false` before the first build. */
|
|
2618
3206
|
pipelineOutdated: boolean;
|
|
3207
|
+
/** @description A recommendation to rebuild, because new or changed content doesn't fit the current outline. `null` when there's no recommendation. A refresh where the content fits again, a successful build, or adding or removing sources clears it. */
|
|
2619
3208
|
rebuildRecommended: {
|
|
3209
|
+
/** @description Why a rebuild is recommended, written to show to users. */
|
|
2620
3210
|
reason: string;
|
|
2621
|
-
/**
|
|
3211
|
+
/**
|
|
3212
|
+
* Format: date-time
|
|
3213
|
+
* @description When the recommendation was made.
|
|
3214
|
+
*/
|
|
2622
3215
|
at: string;
|
|
2623
3216
|
} | null;
|
|
3217
|
+
/** @description Whether the knowledge base has at least one website source. */
|
|
2624
3218
|
hasWebSource: boolean;
|
|
3219
|
+
/** @description Whether the knowledge base has at least one Sanity dataset source. */
|
|
2625
3220
|
hasDatasetSource: boolean;
|
|
3221
|
+
/** @description How many sources the knowledge base uses, and its source limit. */
|
|
2626
3222
|
sourceUsage: {
|
|
3223
|
+
/** @description The number of sources counted toward the limit, including parts split from large sources. */
|
|
2627
3224
|
used: number;
|
|
3225
|
+
/** @description The maximum number of sources the knowledge base can have. */
|
|
2628
3226
|
limit: number;
|
|
2629
3227
|
} | null;
|
|
3228
|
+
/** @description Why a build request would be denied right now, or `null` if you can build. Only `GET .../knowledge-bases/{knowledgeBaseId}` checks it. List and create responses always return `null`. */
|
|
3229
|
+
buildRestriction: {
|
|
3230
|
+
/** @description A stable code for the restriction, such as `planLimitReached`. */
|
|
3231
|
+
code: string;
|
|
3232
|
+
/** @description A readable explanation that you can show to users. */
|
|
3233
|
+
message: string;
|
|
3234
|
+
} | null;
|
|
3235
|
+
/** @description Whether scheduled refresh is on. Only applies to knowledge bases with a website or dataset source. */
|
|
2630
3236
|
refreshEnabled: boolean;
|
|
2631
|
-
/**
|
|
3237
|
+
/**
|
|
3238
|
+
* @description How often scheduled refresh runs: `weekly` (the default) or `monthly`.
|
|
3239
|
+
* @enum {string}
|
|
3240
|
+
*/
|
|
2632
3241
|
refreshFrequency: 'weekly' | 'monthly';
|
|
2633
|
-
/**
|
|
3242
|
+
/**
|
|
3243
|
+
* Format: date-time
|
|
3244
|
+
* @description When the next scheduled refresh runs. `null` when scheduled refresh is off or not scheduled yet. Only `GET .../knowledge-bases/{knowledgeBaseId}` computes it, so list responses return `null`.
|
|
3245
|
+
*/
|
|
2634
3246
|
refreshNextRunAt: string | null;
|
|
3247
|
+
/** @description Whether a refresh is running now. While it's `true`, a new refresh request doesn't start another one. Only `GET .../knowledge-bases/{knowledgeBaseId}` computes it, so list responses return `false`. */
|
|
2635
3248
|
refreshInFlight: boolean;
|
|
3249
|
+
/** @description The number of open issues waiting for review. Always `0` before the first build. */
|
|
2636
3250
|
openIssueCount: number;
|
|
3251
|
+
/** @description The number of active instructions for the knowledge base. */
|
|
2637
3252
|
instructionCount: number;
|
|
2638
|
-
/** @description
|
|
3253
|
+
/** @description Who created the knowledge base. `null` if unknown. */
|
|
2639
3254
|
createdBy: {
|
|
3255
|
+
/** @description The Sanity user ID, or `sanity-system` when Sanity Context made the change. `null` if unknown. */
|
|
2640
3256
|
id: string | null;
|
|
3257
|
+
/** @description The user's name when the action happened. `null` if unknown. For the current name, look up the user by `id`. */
|
|
2641
3258
|
displayName: string | null;
|
|
2642
3259
|
} | null;
|
|
2643
|
-
/**
|
|
3260
|
+
/**
|
|
3261
|
+
* Format: date-time
|
|
3262
|
+
* @description When the knowledge base was created.
|
|
3263
|
+
*/
|
|
2644
3264
|
createdAt: string;
|
|
2645
|
-
/**
|
|
3265
|
+
/**
|
|
3266
|
+
* Format: date-time
|
|
3267
|
+
* @description When the knowledge base was last updated.
|
|
3268
|
+
*/
|
|
2646
3269
|
updatedAt: string;
|
|
2647
3270
|
}[];
|
|
3271
|
+
/** @description The cursor for the next page. Pass it as `cursor` to get more results. `null` when there are no more pages. */
|
|
2648
3272
|
nextCursor: string | null;
|
|
2649
3273
|
};
|
|
2650
3274
|
};
|
|
@@ -2663,83 +3287,160 @@ interface operations {
|
|
|
2663
3287
|
requestBody: {
|
|
2664
3288
|
content: {
|
|
2665
3289
|
'application/json': {
|
|
3290
|
+
/** @description The ID of the organization to create the knowledge base in. */
|
|
2666
3291
|
organizationId: string;
|
|
3292
|
+
/** @description The knowledge base's title. */
|
|
2667
3293
|
title: string;
|
|
3294
|
+
/** @description A short description of what the knowledge base covers. */
|
|
2668
3295
|
description: string;
|
|
2669
3296
|
};
|
|
2670
3297
|
};
|
|
2671
3298
|
};
|
|
2672
3299
|
responses: {
|
|
2673
|
-
/** @description
|
|
3300
|
+
/** @description A knowledge base and its current state. */
|
|
2674
3301
|
201: {
|
|
2675
3302
|
headers: {
|
|
2676
3303
|
[name: string]: unknown;
|
|
2677
3304
|
};
|
|
2678
3305
|
content: {
|
|
2679
3306
|
'application/json': {
|
|
2680
|
-
/**
|
|
3307
|
+
/**
|
|
3308
|
+
* Format: uuid
|
|
3309
|
+
* @description The knowledge base's unique ID, a UUID. Accepted anywhere a `knowledgeBaseId` is expected.
|
|
3310
|
+
*/
|
|
2681
3311
|
id: string;
|
|
3312
|
+
/** @description The knowledge base ID to show users, such as `kb3do82whm`. Accepted anywhere a `knowledgeBaseId` is expected. Treat it as an opaque string. */
|
|
2682
3313
|
publicId: string;
|
|
3314
|
+
/** @description The ID of the organization that owns the knowledge base. */
|
|
2683
3315
|
organizationId: string;
|
|
3316
|
+
/** @description The knowledge base's title. */
|
|
2684
3317
|
title: string;
|
|
3318
|
+
/** @description A short description of what the knowledge base covers. */
|
|
2685
3319
|
description: string;
|
|
2686
|
-
/**
|
|
3320
|
+
/**
|
|
3321
|
+
* @description The knowledge base's build state. `created`: not built yet. `ready`: built, with no open issues. `review`: built, with open issues to review. A failed build doesn't change the state. `building`, `stale`, and `paused` aren't currently returned. To check for a running build, use `isBuilding`.
|
|
3322
|
+
* @enum {string}
|
|
3323
|
+
*/
|
|
2687
3324
|
state: 'created' | 'building' | 'ready' | 'review' | 'stale' | 'paused';
|
|
3325
|
+
/** @description The job ID of the most recent build, or `null` if no build has started. Check its progress with `GET .../jobs/{jobId}`. */
|
|
2688
3326
|
activeJobId: string | null;
|
|
3327
|
+
/** @description Whether a build is running now. */
|
|
2689
3328
|
isBuilding: boolean;
|
|
3329
|
+
/** @description Progress of the most recent build, by stage. `null` until a build reports progress. It can briefly belong to an earlier build, so use it only when its `jobId` matches `activeJobId`. */
|
|
2690
3330
|
buildStageState: {
|
|
3331
|
+
/** @description The ID of the build job this progress belongs to. */
|
|
2691
3332
|
jobId: string;
|
|
3333
|
+
/** @description The build's stages and their progress. Stages that haven't reported yet can be missing. */
|
|
2692
3334
|
stages: {
|
|
2693
|
-
/**
|
|
3335
|
+
/**
|
|
3336
|
+
* @description The stage's ID. The values are listed in the order stages run.
|
|
3337
|
+
* @enum {string}
|
|
3338
|
+
*/
|
|
2694
3339
|
id: 'tldr' | 'map' | 'triage' | 'plan' | 'organize' | 'arrange' | 'write' | 'review' | 'polish';
|
|
2695
|
-
/**
|
|
3340
|
+
/**
|
|
3341
|
+
* @description The stage's status. `pending`: not started. `running`: in progress. `done`: finished. `failed`: the build ended before the stage finished.
|
|
3342
|
+
* @enum {string}
|
|
3343
|
+
*/
|
|
2696
3344
|
status: 'pending' | 'running' | 'done' | 'failed';
|
|
3345
|
+
/** @description The stage's progress counts. Absent when the stage hasn't reported counts. */
|
|
2697
3346
|
units?: {
|
|
2698
|
-
/**
|
|
3347
|
+
/**
|
|
3348
|
+
* @description What `done` and `total` count: `sources`, `groups` of related content, `entries`, or `rounds` of final fixes. A `rounds` stage has no `total`.
|
|
3349
|
+
* @enum {string}
|
|
3350
|
+
*/
|
|
2699
3351
|
unit: 'sources' | 'groups' | 'entries' | 'rounds';
|
|
3352
|
+
/** @description How many units the stage has finished. */
|
|
2700
3353
|
done: number;
|
|
3354
|
+
/** @description How many units the stage will process. Absent when `unit` is `rounds`. */
|
|
2701
3355
|
total?: number;
|
|
2702
3356
|
};
|
|
2703
3357
|
}[];
|
|
2704
3358
|
} | null;
|
|
2705
|
-
/**
|
|
3359
|
+
/**
|
|
3360
|
+
* Format: date-time
|
|
3361
|
+
* @description When a refresh last checked the knowledge base for changes, whether or not anything changed. `null` until the first refresh.
|
|
3362
|
+
*/
|
|
2706
3363
|
lastCheckedAt: string | null;
|
|
2707
|
-
/**
|
|
3364
|
+
/**
|
|
3365
|
+
* Format: date-time
|
|
3366
|
+
* @description When the content last changed: the time of the most recent successful build. `null` if the knowledge base has never built.
|
|
3367
|
+
*/
|
|
2708
3368
|
lastChangedAt: string | null;
|
|
3369
|
+
/** @description Whether sources were added, changed, or removed since the last successful build. Always `false` before the first build. */
|
|
2709
3370
|
hasPendingChanges: boolean;
|
|
3371
|
+
/** @description Counts of sources added, changed, and removed since the last successful build. Only `GET .../knowledge-bases/{knowledgeBaseId}` computes it. `null` in list responses and before the first build. */
|
|
2710
3372
|
pendingChanges: {
|
|
3373
|
+
/** @description Sources added since the last successful build, including sources no successful build has included yet. */
|
|
2711
3374
|
added: number;
|
|
3375
|
+
/** @description Sources whose content changed since the last successful build. */
|
|
2712
3376
|
changed: number;
|
|
3377
|
+
/** @description Sources that recent refreshes no longer find. */
|
|
2713
3378
|
removed: number;
|
|
2714
3379
|
} | null;
|
|
3380
|
+
/** @description Whether Sanity Context has improved how it builds knowledge bases since the last successful build. Rebuild to apply the improvements. Always `false` before the first build. */
|
|
2715
3381
|
pipelineOutdated: boolean;
|
|
3382
|
+
/** @description A recommendation to rebuild, because new or changed content doesn't fit the current outline. `null` when there's no recommendation. A refresh where the content fits again, a successful build, or adding or removing sources clears it. */
|
|
2716
3383
|
rebuildRecommended: {
|
|
3384
|
+
/** @description Why a rebuild is recommended, written to show to users. */
|
|
2717
3385
|
reason: string;
|
|
2718
|
-
/**
|
|
3386
|
+
/**
|
|
3387
|
+
* Format: date-time
|
|
3388
|
+
* @description When the recommendation was made.
|
|
3389
|
+
*/
|
|
2719
3390
|
at: string;
|
|
2720
3391
|
} | null;
|
|
3392
|
+
/** @description Whether the knowledge base has at least one website source. */
|
|
2721
3393
|
hasWebSource: boolean;
|
|
3394
|
+
/** @description Whether the knowledge base has at least one Sanity dataset source. */
|
|
2722
3395
|
hasDatasetSource: boolean;
|
|
3396
|
+
/** @description How many sources the knowledge base uses, and its source limit. */
|
|
2723
3397
|
sourceUsage: {
|
|
3398
|
+
/** @description The number of sources counted toward the limit, including parts split from large sources. */
|
|
2724
3399
|
used: number;
|
|
3400
|
+
/** @description The maximum number of sources the knowledge base can have. */
|
|
2725
3401
|
limit: number;
|
|
2726
3402
|
} | null;
|
|
3403
|
+
/** @description Why a build request would be denied right now, or `null` if you can build. Only `GET .../knowledge-bases/{knowledgeBaseId}` checks it. List and create responses always return `null`. */
|
|
3404
|
+
buildRestriction: {
|
|
3405
|
+
/** @description A stable code for the restriction, such as `planLimitReached`. */
|
|
3406
|
+
code: string;
|
|
3407
|
+
/** @description A readable explanation that you can show to users. */
|
|
3408
|
+
message: string;
|
|
3409
|
+
} | null;
|
|
3410
|
+
/** @description Whether scheduled refresh is on. Only applies to knowledge bases with a website or dataset source. */
|
|
2727
3411
|
refreshEnabled: boolean;
|
|
2728
|
-
/**
|
|
3412
|
+
/**
|
|
3413
|
+
* @description How often scheduled refresh runs: `weekly` (the default) or `monthly`.
|
|
3414
|
+
* @enum {string}
|
|
3415
|
+
*/
|
|
2729
3416
|
refreshFrequency: 'weekly' | 'monthly';
|
|
2730
|
-
/**
|
|
3417
|
+
/**
|
|
3418
|
+
* Format: date-time
|
|
3419
|
+
* @description When the next scheduled refresh runs. `null` when scheduled refresh is off or not scheduled yet. Only `GET .../knowledge-bases/{knowledgeBaseId}` computes it, so list responses return `null`.
|
|
3420
|
+
*/
|
|
2731
3421
|
refreshNextRunAt: string | null;
|
|
3422
|
+
/** @description Whether a refresh is running now. While it's `true`, a new refresh request doesn't start another one. Only `GET .../knowledge-bases/{knowledgeBaseId}` computes it, so list responses return `false`. */
|
|
2732
3423
|
refreshInFlight: boolean;
|
|
3424
|
+
/** @description The number of open issues waiting for review. Always `0` before the first build. */
|
|
2733
3425
|
openIssueCount: number;
|
|
3426
|
+
/** @description The number of active instructions for the knowledge base. */
|
|
2734
3427
|
instructionCount: number;
|
|
2735
|
-
/** @description
|
|
3428
|
+
/** @description Who created the knowledge base. `null` if unknown. */
|
|
2736
3429
|
createdBy: {
|
|
3430
|
+
/** @description The Sanity user ID, or `sanity-system` when Sanity Context made the change. `null` if unknown. */
|
|
2737
3431
|
id: string | null;
|
|
3432
|
+
/** @description The user's name when the action happened. `null` if unknown. For the current name, look up the user by `id`. */
|
|
2738
3433
|
displayName: string | null;
|
|
2739
3434
|
} | null;
|
|
2740
|
-
/**
|
|
3435
|
+
/**
|
|
3436
|
+
* Format: date-time
|
|
3437
|
+
* @description When the knowledge base was created.
|
|
3438
|
+
*/
|
|
2741
3439
|
createdAt: string;
|
|
2742
|
-
/**
|
|
3440
|
+
/**
|
|
3441
|
+
* Format: date-time
|
|
3442
|
+
* @description When the knowledge base was last updated.
|
|
3443
|
+
*/
|
|
2743
3444
|
updatedAt: string;
|
|
2744
3445
|
};
|
|
2745
3446
|
};
|
|
@@ -2751,82 +3452,157 @@ interface operations {
|
|
|
2751
3452
|
query?: never;
|
|
2752
3453
|
header?: never;
|
|
2753
3454
|
path: {
|
|
3455
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
2754
3456
|
knowledgeBaseId: string;
|
|
2755
3457
|
};
|
|
2756
3458
|
cookie?: never;
|
|
2757
3459
|
};
|
|
2758
3460
|
requestBody?: never;
|
|
2759
3461
|
responses: {
|
|
2760
|
-
/** @description
|
|
3462
|
+
/** @description A knowledge base and its current state. */
|
|
2761
3463
|
200: {
|
|
2762
3464
|
headers: {
|
|
2763
3465
|
[name: string]: unknown;
|
|
2764
3466
|
};
|
|
2765
3467
|
content: {
|
|
2766
3468
|
'application/json': {
|
|
2767
|
-
/**
|
|
3469
|
+
/**
|
|
3470
|
+
* Format: uuid
|
|
3471
|
+
* @description The knowledge base's unique ID, a UUID. Accepted anywhere a `knowledgeBaseId` is expected.
|
|
3472
|
+
*/
|
|
2768
3473
|
id: string;
|
|
3474
|
+
/** @description The knowledge base ID to show users, such as `kb3do82whm`. Accepted anywhere a `knowledgeBaseId` is expected. Treat it as an opaque string. */
|
|
2769
3475
|
publicId: string;
|
|
3476
|
+
/** @description The ID of the organization that owns the knowledge base. */
|
|
2770
3477
|
organizationId: string;
|
|
3478
|
+
/** @description The knowledge base's title. */
|
|
2771
3479
|
title: string;
|
|
3480
|
+
/** @description A short description of what the knowledge base covers. */
|
|
2772
3481
|
description: string;
|
|
2773
|
-
/**
|
|
3482
|
+
/**
|
|
3483
|
+
* @description The knowledge base's build state. `created`: not built yet. `ready`: built, with no open issues. `review`: built, with open issues to review. A failed build doesn't change the state. `building`, `stale`, and `paused` aren't currently returned. To check for a running build, use `isBuilding`.
|
|
3484
|
+
* @enum {string}
|
|
3485
|
+
*/
|
|
2774
3486
|
state: 'created' | 'building' | 'ready' | 'review' | 'stale' | 'paused';
|
|
3487
|
+
/** @description The job ID of the most recent build, or `null` if no build has started. Check its progress with `GET .../jobs/{jobId}`. */
|
|
2775
3488
|
activeJobId: string | null;
|
|
3489
|
+
/** @description Whether a build is running now. */
|
|
2776
3490
|
isBuilding: boolean;
|
|
3491
|
+
/** @description Progress of the most recent build, by stage. `null` until a build reports progress. It can briefly belong to an earlier build, so use it only when its `jobId` matches `activeJobId`. */
|
|
2777
3492
|
buildStageState: {
|
|
3493
|
+
/** @description The ID of the build job this progress belongs to. */
|
|
2778
3494
|
jobId: string;
|
|
3495
|
+
/** @description The build's stages and their progress. Stages that haven't reported yet can be missing. */
|
|
2779
3496
|
stages: {
|
|
2780
|
-
/**
|
|
3497
|
+
/**
|
|
3498
|
+
* @description The stage's ID. The values are listed in the order stages run.
|
|
3499
|
+
* @enum {string}
|
|
3500
|
+
*/
|
|
2781
3501
|
id: 'tldr' | 'map' | 'triage' | 'plan' | 'organize' | 'arrange' | 'write' | 'review' | 'polish';
|
|
2782
|
-
/**
|
|
3502
|
+
/**
|
|
3503
|
+
* @description The stage's status. `pending`: not started. `running`: in progress. `done`: finished. `failed`: the build ended before the stage finished.
|
|
3504
|
+
* @enum {string}
|
|
3505
|
+
*/
|
|
2783
3506
|
status: 'pending' | 'running' | 'done' | 'failed';
|
|
3507
|
+
/** @description The stage's progress counts. Absent when the stage hasn't reported counts. */
|
|
2784
3508
|
units?: {
|
|
2785
|
-
/**
|
|
3509
|
+
/**
|
|
3510
|
+
* @description What `done` and `total` count: `sources`, `groups` of related content, `entries`, or `rounds` of final fixes. A `rounds` stage has no `total`.
|
|
3511
|
+
* @enum {string}
|
|
3512
|
+
*/
|
|
2786
3513
|
unit: 'sources' | 'groups' | 'entries' | 'rounds';
|
|
3514
|
+
/** @description How many units the stage has finished. */
|
|
2787
3515
|
done: number;
|
|
3516
|
+
/** @description How many units the stage will process. Absent when `unit` is `rounds`. */
|
|
2788
3517
|
total?: number;
|
|
2789
3518
|
};
|
|
2790
3519
|
}[];
|
|
2791
3520
|
} | null;
|
|
2792
|
-
/**
|
|
3521
|
+
/**
|
|
3522
|
+
* Format: date-time
|
|
3523
|
+
* @description When a refresh last checked the knowledge base for changes, whether or not anything changed. `null` until the first refresh.
|
|
3524
|
+
*/
|
|
2793
3525
|
lastCheckedAt: string | null;
|
|
2794
|
-
/**
|
|
3526
|
+
/**
|
|
3527
|
+
* Format: date-time
|
|
3528
|
+
* @description When the content last changed: the time of the most recent successful build. `null` if the knowledge base has never built.
|
|
3529
|
+
*/
|
|
2795
3530
|
lastChangedAt: string | null;
|
|
3531
|
+
/** @description Whether sources were added, changed, or removed since the last successful build. Always `false` before the first build. */
|
|
2796
3532
|
hasPendingChanges: boolean;
|
|
3533
|
+
/** @description Counts of sources added, changed, and removed since the last successful build. Only `GET .../knowledge-bases/{knowledgeBaseId}` computes it. `null` in list responses and before the first build. */
|
|
2797
3534
|
pendingChanges: {
|
|
3535
|
+
/** @description Sources added since the last successful build, including sources no successful build has included yet. */
|
|
2798
3536
|
added: number;
|
|
3537
|
+
/** @description Sources whose content changed since the last successful build. */
|
|
2799
3538
|
changed: number;
|
|
3539
|
+
/** @description Sources that recent refreshes no longer find. */
|
|
2800
3540
|
removed: number;
|
|
2801
3541
|
} | null;
|
|
3542
|
+
/** @description Whether Sanity Context has improved how it builds knowledge bases since the last successful build. Rebuild to apply the improvements. Always `false` before the first build. */
|
|
2802
3543
|
pipelineOutdated: boolean;
|
|
3544
|
+
/** @description A recommendation to rebuild, because new or changed content doesn't fit the current outline. `null` when there's no recommendation. A refresh where the content fits again, a successful build, or adding or removing sources clears it. */
|
|
2803
3545
|
rebuildRecommended: {
|
|
3546
|
+
/** @description Why a rebuild is recommended, written to show to users. */
|
|
2804
3547
|
reason: string;
|
|
2805
|
-
/**
|
|
3548
|
+
/**
|
|
3549
|
+
* Format: date-time
|
|
3550
|
+
* @description When the recommendation was made.
|
|
3551
|
+
*/
|
|
2806
3552
|
at: string;
|
|
2807
3553
|
} | null;
|
|
3554
|
+
/** @description Whether the knowledge base has at least one website source. */
|
|
2808
3555
|
hasWebSource: boolean;
|
|
3556
|
+
/** @description Whether the knowledge base has at least one Sanity dataset source. */
|
|
2809
3557
|
hasDatasetSource: boolean;
|
|
3558
|
+
/** @description How many sources the knowledge base uses, and its source limit. */
|
|
2810
3559
|
sourceUsage: {
|
|
3560
|
+
/** @description The number of sources counted toward the limit, including parts split from large sources. */
|
|
2811
3561
|
used: number;
|
|
3562
|
+
/** @description The maximum number of sources the knowledge base can have. */
|
|
2812
3563
|
limit: number;
|
|
2813
3564
|
} | null;
|
|
3565
|
+
/** @description Why a build request would be denied right now, or `null` if you can build. Only `GET .../knowledge-bases/{knowledgeBaseId}` checks it. List and create responses always return `null`. */
|
|
3566
|
+
buildRestriction: {
|
|
3567
|
+
/** @description A stable code for the restriction, such as `planLimitReached`. */
|
|
3568
|
+
code: string;
|
|
3569
|
+
/** @description A readable explanation that you can show to users. */
|
|
3570
|
+
message: string;
|
|
3571
|
+
} | null;
|
|
3572
|
+
/** @description Whether scheduled refresh is on. Only applies to knowledge bases with a website or dataset source. */
|
|
2814
3573
|
refreshEnabled: boolean;
|
|
2815
|
-
/**
|
|
3574
|
+
/**
|
|
3575
|
+
* @description How often scheduled refresh runs: `weekly` (the default) or `monthly`.
|
|
3576
|
+
* @enum {string}
|
|
3577
|
+
*/
|
|
2816
3578
|
refreshFrequency: 'weekly' | 'monthly';
|
|
2817
|
-
/**
|
|
3579
|
+
/**
|
|
3580
|
+
* Format: date-time
|
|
3581
|
+
* @description When the next scheduled refresh runs. `null` when scheduled refresh is off or not scheduled yet. Only `GET .../knowledge-bases/{knowledgeBaseId}` computes it, so list responses return `null`.
|
|
3582
|
+
*/
|
|
2818
3583
|
refreshNextRunAt: string | null;
|
|
3584
|
+
/** @description Whether a refresh is running now. While it's `true`, a new refresh request doesn't start another one. Only `GET .../knowledge-bases/{knowledgeBaseId}` computes it, so list responses return `false`. */
|
|
2819
3585
|
refreshInFlight: boolean;
|
|
3586
|
+
/** @description The number of open issues waiting for review. Always `0` before the first build. */
|
|
2820
3587
|
openIssueCount: number;
|
|
3588
|
+
/** @description The number of active instructions for the knowledge base. */
|
|
2821
3589
|
instructionCount: number;
|
|
2822
|
-
/** @description
|
|
3590
|
+
/** @description Who created the knowledge base. `null` if unknown. */
|
|
2823
3591
|
createdBy: {
|
|
3592
|
+
/** @description The Sanity user ID, or `sanity-system` when Sanity Context made the change. `null` if unknown. */
|
|
2824
3593
|
id: string | null;
|
|
3594
|
+
/** @description The user's name when the action happened. `null` if unknown. For the current name, look up the user by `id`. */
|
|
2825
3595
|
displayName: string | null;
|
|
2826
3596
|
} | null;
|
|
2827
|
-
/**
|
|
3597
|
+
/**
|
|
3598
|
+
* Format: date-time
|
|
3599
|
+
* @description When the knowledge base was created.
|
|
3600
|
+
*/
|
|
2828
3601
|
createdAt: string;
|
|
2829
|
-
/**
|
|
3602
|
+
/**
|
|
3603
|
+
* Format: date-time
|
|
3604
|
+
* @description When the knowledge base was last updated.
|
|
3605
|
+
*/
|
|
2830
3606
|
updatedAt: string;
|
|
2831
3607
|
};
|
|
2832
3608
|
};
|
|
@@ -2838,13 +3614,14 @@ interface operations {
|
|
|
2838
3614
|
query?: never;
|
|
2839
3615
|
header?: never;
|
|
2840
3616
|
path: {
|
|
3617
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
2841
3618
|
knowledgeBaseId: string;
|
|
2842
3619
|
};
|
|
2843
3620
|
cookie?: never;
|
|
2844
3621
|
};
|
|
2845
3622
|
requestBody?: never;
|
|
2846
3623
|
responses: {
|
|
2847
|
-
/** @description
|
|
3624
|
+
/** @description The knowledge base was deleted. */
|
|
2848
3625
|
204: {
|
|
2849
3626
|
headers: {
|
|
2850
3627
|
[name: string]: unknown;
|
|
@@ -2860,6 +3637,7 @@ interface operations {
|
|
|
2860
3637
|
query?: never;
|
|
2861
3638
|
header?: never;
|
|
2862
3639
|
path: {
|
|
3640
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
2863
3641
|
knowledgeBaseId: string;
|
|
2864
3642
|
};
|
|
2865
3643
|
cookie?: never;
|
|
@@ -2867,85 +3645,165 @@ interface operations {
|
|
|
2867
3645
|
requestBody: {
|
|
2868
3646
|
content: {
|
|
2869
3647
|
'application/json': {
|
|
3648
|
+
/** @description The knowledge base's new title. */
|
|
2870
3649
|
title?: string;
|
|
3650
|
+
/** @description The knowledge base's new description. */
|
|
2871
3651
|
description?: string;
|
|
3652
|
+
/** @description Whether scheduled refresh is on. Turning it off stops only scheduled refreshes, so you can still start a refresh yourself. Turning it on requires a plan that includes scheduled refresh. Requires a website or dataset source. */
|
|
2872
3653
|
refreshEnabled?: boolean;
|
|
2873
|
-
/**
|
|
3654
|
+
/**
|
|
3655
|
+
* @description How often scheduled refresh runs: `weekly` or `monthly`. Requires a website or dataset source and a plan that includes scheduled refresh.
|
|
3656
|
+
* @enum {string}
|
|
3657
|
+
*/
|
|
2874
3658
|
refreshFrequency?: 'weekly' | 'monthly';
|
|
2875
3659
|
};
|
|
2876
3660
|
};
|
|
2877
3661
|
};
|
|
2878
3662
|
responses: {
|
|
2879
|
-
/** @description
|
|
3663
|
+
/** @description A knowledge base and its current state. */
|
|
2880
3664
|
200: {
|
|
2881
3665
|
headers: {
|
|
2882
3666
|
[name: string]: unknown;
|
|
2883
3667
|
};
|
|
2884
3668
|
content: {
|
|
2885
3669
|
'application/json': {
|
|
2886
|
-
/**
|
|
3670
|
+
/**
|
|
3671
|
+
* Format: uuid
|
|
3672
|
+
* @description The knowledge base's unique ID, a UUID. Accepted anywhere a `knowledgeBaseId` is expected.
|
|
3673
|
+
*/
|
|
2887
3674
|
id: string;
|
|
3675
|
+
/** @description The knowledge base ID to show users, such as `kb3do82whm`. Accepted anywhere a `knowledgeBaseId` is expected. Treat it as an opaque string. */
|
|
2888
3676
|
publicId: string;
|
|
3677
|
+
/** @description The ID of the organization that owns the knowledge base. */
|
|
2889
3678
|
organizationId: string;
|
|
3679
|
+
/** @description The knowledge base's title. */
|
|
2890
3680
|
title: string;
|
|
3681
|
+
/** @description A short description of what the knowledge base covers. */
|
|
2891
3682
|
description: string;
|
|
2892
|
-
/**
|
|
3683
|
+
/**
|
|
3684
|
+
* @description The knowledge base's build state. `created`: not built yet. `ready`: built, with no open issues. `review`: built, with open issues to review. A failed build doesn't change the state. `building`, `stale`, and `paused` aren't currently returned. To check for a running build, use `isBuilding`.
|
|
3685
|
+
* @enum {string}
|
|
3686
|
+
*/
|
|
2893
3687
|
state: 'created' | 'building' | 'ready' | 'review' | 'stale' | 'paused';
|
|
3688
|
+
/** @description The job ID of the most recent build, or `null` if no build has started. Check its progress with `GET .../jobs/{jobId}`. */
|
|
2894
3689
|
activeJobId: string | null;
|
|
3690
|
+
/** @description Whether a build is running now. */
|
|
2895
3691
|
isBuilding: boolean;
|
|
3692
|
+
/** @description Progress of the most recent build, by stage. `null` until a build reports progress. It can briefly belong to an earlier build, so use it only when its `jobId` matches `activeJobId`. */
|
|
2896
3693
|
buildStageState: {
|
|
3694
|
+
/** @description The ID of the build job this progress belongs to. */
|
|
2897
3695
|
jobId: string;
|
|
3696
|
+
/** @description The build's stages and their progress. Stages that haven't reported yet can be missing. */
|
|
2898
3697
|
stages: {
|
|
2899
|
-
/**
|
|
3698
|
+
/**
|
|
3699
|
+
* @description The stage's ID. The values are listed in the order stages run.
|
|
3700
|
+
* @enum {string}
|
|
3701
|
+
*/
|
|
2900
3702
|
id: 'tldr' | 'map' | 'triage' | 'plan' | 'organize' | 'arrange' | 'write' | 'review' | 'polish';
|
|
2901
|
-
/**
|
|
3703
|
+
/**
|
|
3704
|
+
* @description The stage's status. `pending`: not started. `running`: in progress. `done`: finished. `failed`: the build ended before the stage finished.
|
|
3705
|
+
* @enum {string}
|
|
3706
|
+
*/
|
|
2902
3707
|
status: 'pending' | 'running' | 'done' | 'failed';
|
|
3708
|
+
/** @description The stage's progress counts. Absent when the stage hasn't reported counts. */
|
|
2903
3709
|
units?: {
|
|
2904
|
-
/**
|
|
3710
|
+
/**
|
|
3711
|
+
* @description What `done` and `total` count: `sources`, `groups` of related content, `entries`, or `rounds` of final fixes. A `rounds` stage has no `total`.
|
|
3712
|
+
* @enum {string}
|
|
3713
|
+
*/
|
|
2905
3714
|
unit: 'sources' | 'groups' | 'entries' | 'rounds';
|
|
3715
|
+
/** @description How many units the stage has finished. */
|
|
2906
3716
|
done: number;
|
|
3717
|
+
/** @description How many units the stage will process. Absent when `unit` is `rounds`. */
|
|
2907
3718
|
total?: number;
|
|
2908
3719
|
};
|
|
2909
3720
|
}[];
|
|
2910
3721
|
} | null;
|
|
2911
|
-
/**
|
|
3722
|
+
/**
|
|
3723
|
+
* Format: date-time
|
|
3724
|
+
* @description When a refresh last checked the knowledge base for changes, whether or not anything changed. `null` until the first refresh.
|
|
3725
|
+
*/
|
|
2912
3726
|
lastCheckedAt: string | null;
|
|
2913
|
-
/**
|
|
3727
|
+
/**
|
|
3728
|
+
* Format: date-time
|
|
3729
|
+
* @description When the content last changed: the time of the most recent successful build. `null` if the knowledge base has never built.
|
|
3730
|
+
*/
|
|
2914
3731
|
lastChangedAt: string | null;
|
|
3732
|
+
/** @description Whether sources were added, changed, or removed since the last successful build. Always `false` before the first build. */
|
|
2915
3733
|
hasPendingChanges: boolean;
|
|
3734
|
+
/** @description Counts of sources added, changed, and removed since the last successful build. Only `GET .../knowledge-bases/{knowledgeBaseId}` computes it. `null` in list responses and before the first build. */
|
|
2916
3735
|
pendingChanges: {
|
|
3736
|
+
/** @description Sources added since the last successful build, including sources no successful build has included yet. */
|
|
2917
3737
|
added: number;
|
|
3738
|
+
/** @description Sources whose content changed since the last successful build. */
|
|
2918
3739
|
changed: number;
|
|
3740
|
+
/** @description Sources that recent refreshes no longer find. */
|
|
2919
3741
|
removed: number;
|
|
2920
3742
|
} | null;
|
|
3743
|
+
/** @description Whether Sanity Context has improved how it builds knowledge bases since the last successful build. Rebuild to apply the improvements. Always `false` before the first build. */
|
|
2921
3744
|
pipelineOutdated: boolean;
|
|
3745
|
+
/** @description A recommendation to rebuild, because new or changed content doesn't fit the current outline. `null` when there's no recommendation. A refresh where the content fits again, a successful build, or adding or removing sources clears it. */
|
|
2922
3746
|
rebuildRecommended: {
|
|
3747
|
+
/** @description Why a rebuild is recommended, written to show to users. */
|
|
2923
3748
|
reason: string;
|
|
2924
|
-
/**
|
|
3749
|
+
/**
|
|
3750
|
+
* Format: date-time
|
|
3751
|
+
* @description When the recommendation was made.
|
|
3752
|
+
*/
|
|
2925
3753
|
at: string;
|
|
2926
3754
|
} | null;
|
|
3755
|
+
/** @description Whether the knowledge base has at least one website source. */
|
|
2927
3756
|
hasWebSource: boolean;
|
|
3757
|
+
/** @description Whether the knowledge base has at least one Sanity dataset source. */
|
|
2928
3758
|
hasDatasetSource: boolean;
|
|
3759
|
+
/** @description How many sources the knowledge base uses, and its source limit. */
|
|
2929
3760
|
sourceUsage: {
|
|
3761
|
+
/** @description The number of sources counted toward the limit, including parts split from large sources. */
|
|
2930
3762
|
used: number;
|
|
3763
|
+
/** @description The maximum number of sources the knowledge base can have. */
|
|
2931
3764
|
limit: number;
|
|
2932
3765
|
} | null;
|
|
3766
|
+
/** @description Why a build request would be denied right now, or `null` if you can build. Only `GET .../knowledge-bases/{knowledgeBaseId}` checks it. List and create responses always return `null`. */
|
|
3767
|
+
buildRestriction: {
|
|
3768
|
+
/** @description A stable code for the restriction, such as `planLimitReached`. */
|
|
3769
|
+
code: string;
|
|
3770
|
+
/** @description A readable explanation that you can show to users. */
|
|
3771
|
+
message: string;
|
|
3772
|
+
} | null;
|
|
3773
|
+
/** @description Whether scheduled refresh is on. Only applies to knowledge bases with a website or dataset source. */
|
|
2933
3774
|
refreshEnabled: boolean;
|
|
2934
|
-
/**
|
|
3775
|
+
/**
|
|
3776
|
+
* @description How often scheduled refresh runs: `weekly` (the default) or `monthly`.
|
|
3777
|
+
* @enum {string}
|
|
3778
|
+
*/
|
|
2935
3779
|
refreshFrequency: 'weekly' | 'monthly';
|
|
2936
|
-
/**
|
|
3780
|
+
/**
|
|
3781
|
+
* Format: date-time
|
|
3782
|
+
* @description When the next scheduled refresh runs. `null` when scheduled refresh is off or not scheduled yet. Only `GET .../knowledge-bases/{knowledgeBaseId}` computes it, so list responses return `null`.
|
|
3783
|
+
*/
|
|
2937
3784
|
refreshNextRunAt: string | null;
|
|
3785
|
+
/** @description Whether a refresh is running now. While it's `true`, a new refresh request doesn't start another one. Only `GET .../knowledge-bases/{knowledgeBaseId}` computes it, so list responses return `false`. */
|
|
2938
3786
|
refreshInFlight: boolean;
|
|
3787
|
+
/** @description The number of open issues waiting for review. Always `0` before the first build. */
|
|
2939
3788
|
openIssueCount: number;
|
|
3789
|
+
/** @description The number of active instructions for the knowledge base. */
|
|
2940
3790
|
instructionCount: number;
|
|
2941
|
-
/** @description
|
|
3791
|
+
/** @description Who created the knowledge base. `null` if unknown. */
|
|
2942
3792
|
createdBy: {
|
|
3793
|
+
/** @description The Sanity user ID, or `sanity-system` when Sanity Context made the change. `null` if unknown. */
|
|
2943
3794
|
id: string | null;
|
|
3795
|
+
/** @description The user's name when the action happened. `null` if unknown. For the current name, look up the user by `id`. */
|
|
2944
3796
|
displayName: string | null;
|
|
2945
3797
|
} | null;
|
|
2946
|
-
/**
|
|
3798
|
+
/**
|
|
3799
|
+
* Format: date-time
|
|
3800
|
+
* @description When the knowledge base was created.
|
|
3801
|
+
*/
|
|
2947
3802
|
createdAt: string;
|
|
2948
|
-
/**
|
|
3803
|
+
/**
|
|
3804
|
+
* Format: date-time
|
|
3805
|
+
* @description When the knowledge base was last updated.
|
|
3806
|
+
*/
|
|
2949
3807
|
updatedAt: string;
|
|
2950
3808
|
};
|
|
2951
3809
|
};
|
|
@@ -2957,19 +3815,21 @@ interface operations {
|
|
|
2957
3815
|
query?: never;
|
|
2958
3816
|
header?: never;
|
|
2959
3817
|
path: {
|
|
3818
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
2960
3819
|
knowledgeBaseId: string;
|
|
2961
3820
|
};
|
|
2962
3821
|
cookie?: never;
|
|
2963
3822
|
};
|
|
2964
3823
|
requestBody?: never;
|
|
2965
3824
|
responses: {
|
|
2966
|
-
/** @description
|
|
3825
|
+
/** @description A queued job that you can poll for progress. */
|
|
2967
3826
|
202: {
|
|
2968
3827
|
headers: {
|
|
2969
3828
|
[name: string]: unknown;
|
|
2970
3829
|
};
|
|
2971
3830
|
content: {
|
|
2972
3831
|
'application/json': {
|
|
3832
|
+
/** @description The queued job's ID. Check its progress with `GET .../jobs/{jobId}`. */
|
|
2973
3833
|
jobId: string;
|
|
2974
3834
|
};
|
|
2975
3835
|
};
|
|
@@ -2981,19 +3841,21 @@ interface operations {
|
|
|
2981
3841
|
query?: never;
|
|
2982
3842
|
header?: never;
|
|
2983
3843
|
path: {
|
|
3844
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
2984
3845
|
knowledgeBaseId: string;
|
|
2985
3846
|
};
|
|
2986
3847
|
cookie?: never;
|
|
2987
3848
|
};
|
|
2988
3849
|
requestBody?: never;
|
|
2989
3850
|
responses: {
|
|
2990
|
-
/** @description
|
|
3851
|
+
/** @description The result of the cancel request. */
|
|
2991
3852
|
200: {
|
|
2992
3853
|
headers: {
|
|
2993
3854
|
[name: string]: unknown;
|
|
2994
3855
|
};
|
|
2995
3856
|
content: {
|
|
2996
3857
|
'application/json': {
|
|
3858
|
+
/** @description Whether a running build was cancelled. `false` when no build was running. */
|
|
2997
3859
|
cancelled: boolean;
|
|
2998
3860
|
};
|
|
2999
3861
|
};
|
|
@@ -3005,24 +3867,31 @@ interface operations {
|
|
|
3005
3867
|
query?: never;
|
|
3006
3868
|
header?: never;
|
|
3007
3869
|
path: {
|
|
3870
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
3008
3871
|
knowledgeBaseId: string;
|
|
3872
|
+
/** @description The entry's slash-delimited path, such as `pricing/plans/free`, URL-encoded. */
|
|
3009
3873
|
entryPath: string;
|
|
3010
3874
|
};
|
|
3011
3875
|
cookie?: never;
|
|
3012
3876
|
};
|
|
3013
3877
|
requestBody?: never;
|
|
3014
3878
|
responses: {
|
|
3015
|
-
/** @description
|
|
3879
|
+
/** @description The job that rebuilds the entry, and the other entries that share its sources. */
|
|
3016
3880
|
202: {
|
|
3017
3881
|
headers: {
|
|
3018
3882
|
[name: string]: unknown;
|
|
3019
3883
|
};
|
|
3020
3884
|
content: {
|
|
3021
3885
|
'application/json': {
|
|
3886
|
+
/** @description ID of the job that rebuilds the entry. Poll it with `GET .../jobs/{jobId}`. */
|
|
3022
3887
|
jobId: string;
|
|
3888
|
+
/** @description Other entries that cite any of this entry's sources. An instruction applies to every entry that cites its sources, so these entries can change when they are next rebuilt. */
|
|
3023
3889
|
affectedEntries: {
|
|
3890
|
+
/** @description The entry's document ID. */
|
|
3024
3891
|
id: string;
|
|
3892
|
+
/** @description The entry's path, such as `products/api/webhooks`. */
|
|
3025
3893
|
path: string;
|
|
3894
|
+
/** @description The entry's title. */
|
|
3026
3895
|
title: string;
|
|
3027
3896
|
}[];
|
|
3028
3897
|
};
|
|
@@ -3033,68 +3902,110 @@ interface operations {
|
|
|
3033
3902
|
listImports: {
|
|
3034
3903
|
parameters: {
|
|
3035
3904
|
query?: {
|
|
3905
|
+
/** @description The `nextCursor` value from the previous page. Omit it to get the first page. */
|
|
3036
3906
|
cursor?: string;
|
|
3907
|
+
/** @description The maximum number of items to return. */
|
|
3037
3908
|
limit?: number;
|
|
3038
3909
|
};
|
|
3039
3910
|
header?: never;
|
|
3040
3911
|
path: {
|
|
3912
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
3041
3913
|
knowledgeBaseId: string;
|
|
3042
3914
|
};
|
|
3043
3915
|
cookie?: never;
|
|
3044
3916
|
};
|
|
3045
3917
|
requestBody?: never;
|
|
3046
3918
|
responses: {
|
|
3047
|
-
/** @description
|
|
3919
|
+
/** @description A page of imports. */
|
|
3048
3920
|
200: {
|
|
3049
3921
|
headers: {
|
|
3050
3922
|
[name: string]: unknown;
|
|
3051
3923
|
};
|
|
3052
3924
|
content: {
|
|
3053
3925
|
'application/json': {
|
|
3926
|
+
/** @description The items on this page. */
|
|
3054
3927
|
data: {
|
|
3055
|
-
/**
|
|
3928
|
+
/**
|
|
3929
|
+
* Format: uuid
|
|
3930
|
+
* @description The import's ID.
|
|
3931
|
+
*/
|
|
3056
3932
|
id: string;
|
|
3057
|
-
/**
|
|
3933
|
+
/**
|
|
3934
|
+
* Format: uuid
|
|
3935
|
+
* @description The `id` of the knowledge base that the import belongs to.
|
|
3936
|
+
*/
|
|
3058
3937
|
knowledgeBaseId: string;
|
|
3938
|
+
/** @description A label for the import: the file name for an upload, the root URL for a crawl, a label for a dataset query, or the title for inline text. */
|
|
3059
3939
|
name: string | null;
|
|
3940
|
+
/** @description The size of the uploaded file or inline text, in bytes. `null` for crawl and dataset imports, and until a file upload completes. */
|
|
3060
3941
|
sizeBytes: number | null;
|
|
3061
|
-
/**
|
|
3942
|
+
/**
|
|
3943
|
+
* @description The import's status. `uploading`: waiting for the file upload to complete. `processing`: content is being fetched and processed. `complete`: processing finished. `failed`: the import, or at least one of its sources, couldn't be processed. See `statusDetail` and `error` for details.
|
|
3944
|
+
* @enum {string}
|
|
3945
|
+
*/
|
|
3062
3946
|
status: 'uploading' | 'processing' | 'complete' | 'failed';
|
|
3063
|
-
/**
|
|
3947
|
+
/**
|
|
3948
|
+
* @description The kind of sources the import produces. `file`: uploads and inline text. `web`: crawls. `dataset`: Sanity datasets.
|
|
3949
|
+
* @enum {string}
|
|
3950
|
+
*/
|
|
3064
3951
|
sourceKind: 'web' | 'file' | 'dataset';
|
|
3065
|
-
/**
|
|
3952
|
+
/**
|
|
3953
|
+
* Format: date-time
|
|
3954
|
+
* @description When the import's website or dataset was last checked, even if nothing changed. `null` for file and text imports, and before the first check.
|
|
3955
|
+
*/
|
|
3066
3956
|
lastCheckedAt: string | null;
|
|
3957
|
+
/** @description The number of sources the import produced, such as crawled pages or files in an archive. Doesn't count parts split from large sources. */
|
|
3067
3958
|
sourceCount: number;
|
|
3959
|
+
/** @description The number of sources expected to be distilled, including parts split from large sources. Excludes skipped sources. */
|
|
3068
3960
|
totalDistillableCount: number;
|
|
3961
|
+
/** @description The number of sources distilled so far. Compare it with `totalDistillableCount` to show progress. */
|
|
3069
3962
|
distilledCount: number;
|
|
3963
|
+
/** @description The number of sources skipped because their file type isn't supported, such as images. */
|
|
3070
3964
|
unsupportedCount: number;
|
|
3965
|
+
/** @description A note about the import's outcome, written to show to users. It explains a failure or a partial result, such as a crawl that stopped at the source limit. `null` when there's nothing to note. Prefer it over `error`. */
|
|
3071
3966
|
statusDetail: string | null;
|
|
3967
|
+
/** @description When `status` is `failed`, a readable reason from one failed source. `null` for any other status, or when no single source failed. */
|
|
3072
3968
|
error: string | null;
|
|
3073
|
-
/** @description
|
|
3969
|
+
/** @description The options the next crawl of this website uses. An empty object means the defaults. `null` for other import types, and for a crawl whose root URL was removed. */
|
|
3074
3970
|
crawlOptions: {
|
|
3971
|
+
/** @description Regular expressions for URL paths to crawl. When set, the crawl only includes pages whose path matches one of them. */
|
|
3075
3972
|
includePaths?: string[];
|
|
3973
|
+
/** @description Regular expressions for URL paths to skip. Pages whose path matches one of them aren't crawled. */
|
|
3076
3974
|
excludePaths?: string[];
|
|
3975
|
+
/** @description How many levels deep the crawl goes from the root URL. */
|
|
3077
3976
|
maxDepth?: number;
|
|
3977
|
+
/** @description Whether to crawl only the pages listed in the site's sitemap. */
|
|
3078
3978
|
sitemapOnly?: boolean;
|
|
3979
|
+
/** @description Whether to treat URLs that differ only by query string as one page. New crawls set it to `true` unless you set it. Set it to `false` when the query string selects different content, such as pagination. */
|
|
3079
3980
|
ignoreQueryParameters?: boolean;
|
|
3981
|
+
/** @description The maximum number of pages to crawl. The crawl can stop sooner when the knowledge base reaches its source limit. */
|
|
3080
3982
|
pageLimit?: number;
|
|
3081
3983
|
} | null;
|
|
3082
|
-
/** @description
|
|
3984
|
+
/** @description The Sanity project, dataset, and full query a dataset import reads from. `null` for other import types. */
|
|
3083
3985
|
datasetSource: {
|
|
3986
|
+
/** @description The ID of the Sanity project the documents come from. */
|
|
3084
3987
|
sanityProjectId: string;
|
|
3988
|
+
/** @description The dataset the documents come from. */
|
|
3085
3989
|
sanityDatasetId: string;
|
|
3990
|
+
/** @description The full GROQ query that selects the documents, exactly as saved. */
|
|
3086
3991
|
query: string;
|
|
3087
3992
|
} | null;
|
|
3088
|
-
/** @description
|
|
3993
|
+
/** @description Who added the import. `null` if unknown. */
|
|
3089
3994
|
createdBy: {
|
|
3995
|
+
/** @description The Sanity user ID, or `sanity-system` when Sanity Context made the change. `null` if unknown. */
|
|
3090
3996
|
id: string | null;
|
|
3997
|
+
/** @description The user's name when the action happened. `null` if unknown. For the current name, look up the user by `id`. */
|
|
3091
3998
|
displayName: string | null;
|
|
3092
3999
|
} | null;
|
|
3093
|
-
/**
|
|
4000
|
+
/**
|
|
4001
|
+
* Format: date-time
|
|
4002
|
+
* @description When the import was created.
|
|
4003
|
+
*/
|
|
3094
4004
|
createdAt: string;
|
|
3095
4005
|
/** Format: date-time */
|
|
3096
4006
|
completedAt: string | null;
|
|
3097
4007
|
}[];
|
|
4008
|
+
/** @description The cursor for the next page. Pass it as `cursor` to get more results. `null` when there are no more pages. */
|
|
3098
4009
|
nextCursor: string | null;
|
|
3099
4010
|
};
|
|
3100
4011
|
};
|
|
@@ -3106,54 +4017,80 @@ interface operations {
|
|
|
3106
4017
|
query?: never;
|
|
3107
4018
|
header?: never;
|
|
3108
4019
|
path: {
|
|
4020
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
3109
4021
|
knowledgeBaseId: string;
|
|
3110
4022
|
};
|
|
3111
4023
|
cookie?: never;
|
|
3112
4024
|
};
|
|
3113
|
-
/** @description
|
|
4025
|
+
/** @description Content to add to a knowledge base. The `type` field sets the kind of import. */
|
|
3114
4026
|
requestBody: {
|
|
3115
4027
|
content: {
|
|
3116
4028
|
'application/json': {
|
|
3117
|
-
/**
|
|
4029
|
+
/**
|
|
4030
|
+
* @description The import type. `text` imports inline content.
|
|
4031
|
+
* @enum {string}
|
|
4032
|
+
*/
|
|
3118
4033
|
type: 'text';
|
|
4034
|
+
/** @description The import's title, shown in the list of imports. */
|
|
3119
4035
|
title: string;
|
|
4036
|
+
/** @description The text or markdown to import, up to 1,000,000 bytes of UTF-8. */
|
|
3120
4037
|
content: string;
|
|
3121
4038
|
/**
|
|
4039
|
+
* @description The format of `content`: `text/markdown` (the default) or `text/plain`.
|
|
3122
4040
|
* @default text/markdown
|
|
3123
4041
|
* @enum {string}
|
|
3124
4042
|
*/
|
|
3125
4043
|
contentType?: 'text/markdown' | 'text/plain';
|
|
3126
4044
|
} | {
|
|
3127
|
-
/**
|
|
4045
|
+
/**
|
|
4046
|
+
* Format: uri
|
|
4047
|
+
* @description The URL to start crawling from. It must be a public `http` or `https` URL.
|
|
4048
|
+
*/
|
|
3128
4049
|
url: string;
|
|
3129
|
-
/** @description
|
|
4050
|
+
/** @description Options for the crawl. Options you omit use the defaults. */
|
|
3130
4051
|
options?: {
|
|
4052
|
+
/** @description Regular expressions for URL paths to crawl. When set, the crawl only includes pages whose path matches one of them. */
|
|
3131
4053
|
includePaths?: string[];
|
|
4054
|
+
/** @description Regular expressions for URL paths to skip. Pages whose path matches one of them aren't crawled. */
|
|
3132
4055
|
excludePaths?: string[];
|
|
4056
|
+
/** @description How many levels deep the crawl goes from the root URL. */
|
|
3133
4057
|
maxDepth?: number;
|
|
4058
|
+
/** @description Whether to crawl only the pages listed in the site's sitemap. */
|
|
3134
4059
|
sitemapOnly?: boolean;
|
|
4060
|
+
/** @description Whether to treat URLs that differ only by query string as one page. New crawls set it to `true` unless you set it. Set it to `false` when the query string selects different content, such as pagination. */
|
|
3135
4061
|
ignoreQueryParameters?: boolean;
|
|
4062
|
+
/** @description The maximum number of pages to crawl. The crawl can stop sooner when the knowledge base reaches its source limit. */
|
|
3136
4063
|
pageLimit?: number;
|
|
3137
4064
|
};
|
|
3138
|
-
/**
|
|
4065
|
+
/**
|
|
4066
|
+
* @description The import type. `crawl` imports a website.
|
|
4067
|
+
* @enum {string}
|
|
4068
|
+
*/
|
|
3139
4069
|
type: 'crawl';
|
|
3140
4070
|
} | {
|
|
4071
|
+
/** @description The ID of the Sanity project to read documents from. You need full read access to the dataset and, on its project, the Administrator or Developer role or a custom role that can create datasets. */
|
|
3141
4072
|
sanityProjectId: string;
|
|
4073
|
+
/** @description The dataset to read documents from, in the project set by `sanityProjectId`. */
|
|
3142
4074
|
sanityDatasetId: string;
|
|
4075
|
+
/** @description A GROQ query that selects the documents to import, with an optional projection. It can match up to 5,000 documents. Each refresh runs the query again. */
|
|
3143
4076
|
query: string;
|
|
3144
|
-
/**
|
|
4077
|
+
/**
|
|
4078
|
+
* @description The import type. `dataset` imports documents from a Sanity dataset.
|
|
4079
|
+
* @enum {string}
|
|
4080
|
+
*/
|
|
3145
4081
|
type: 'dataset';
|
|
3146
4082
|
};
|
|
3147
4083
|
};
|
|
3148
4084
|
};
|
|
3149
4085
|
responses: {
|
|
3150
|
-
/** @description
|
|
4086
|
+
/** @description A queued job that you can poll for progress. */
|
|
3151
4087
|
202: {
|
|
3152
4088
|
headers: {
|
|
3153
4089
|
[name: string]: unknown;
|
|
3154
4090
|
};
|
|
3155
4091
|
content: {
|
|
3156
4092
|
'application/json': {
|
|
4093
|
+
/** @description The queued job's ID. Check its progress with `GET .../jobs/{jobId}`. */
|
|
3157
4094
|
jobId: string;
|
|
3158
4095
|
};
|
|
3159
4096
|
};
|
|
@@ -3165,6 +4102,7 @@ interface operations {
|
|
|
3165
4102
|
query?: never;
|
|
3166
4103
|
header?: never;
|
|
3167
4104
|
path: {
|
|
4105
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
3168
4106
|
knowledgeBaseId: string;
|
|
3169
4107
|
};
|
|
3170
4108
|
cookie?: never;
|
|
@@ -3172,22 +4110,30 @@ interface operations {
|
|
|
3172
4110
|
requestBody: {
|
|
3173
4111
|
content: {
|
|
3174
4112
|
'application/json': {
|
|
4113
|
+
/** @description The file's name. */
|
|
3175
4114
|
filename: string;
|
|
4115
|
+
/** @description The file's MIME type. If you set it, the `PUT` upload must send the same `Content-Type` header. */
|
|
3176
4116
|
contentType?: string;
|
|
3177
4117
|
};
|
|
3178
4118
|
};
|
|
3179
4119
|
};
|
|
3180
4120
|
responses: {
|
|
3181
|
-
/** @description
|
|
4121
|
+
/** @description The new file import and the URL to upload the file to. */
|
|
3182
4122
|
201: {
|
|
3183
4123
|
headers: {
|
|
3184
4124
|
[name: string]: unknown;
|
|
3185
4125
|
};
|
|
3186
4126
|
content: {
|
|
3187
4127
|
'application/json': {
|
|
3188
|
-
/**
|
|
4128
|
+
/**
|
|
4129
|
+
* Format: uuid
|
|
4130
|
+
* @description The ID of the new import. Use it to complete the upload and track the import.
|
|
4131
|
+
*/
|
|
3189
4132
|
importId: string;
|
|
3190
|
-
/**
|
|
4133
|
+
/**
|
|
4134
|
+
* Format: uri
|
|
4135
|
+
* @description A signed URL to send the file to in a single `PUT` request. It expires after one hour.
|
|
4136
|
+
*/
|
|
3191
4137
|
uploadUrl: string;
|
|
3192
4138
|
};
|
|
3193
4139
|
};
|
|
@@ -3199,20 +4145,23 @@ interface operations {
|
|
|
3199
4145
|
query?: never;
|
|
3200
4146
|
header?: never;
|
|
3201
4147
|
path: {
|
|
4148
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
3202
4149
|
knowledgeBaseId: string;
|
|
4150
|
+
/** @description The import's ID. */
|
|
3203
4151
|
importId: string;
|
|
3204
4152
|
};
|
|
3205
4153
|
cookie?: never;
|
|
3206
4154
|
};
|
|
3207
4155
|
requestBody?: never;
|
|
3208
4156
|
responses: {
|
|
3209
|
-
/** @description
|
|
4157
|
+
/** @description A queued job that you can poll for progress. */
|
|
3210
4158
|
202: {
|
|
3211
4159
|
headers: {
|
|
3212
4160
|
[name: string]: unknown;
|
|
3213
4161
|
};
|
|
3214
4162
|
content: {
|
|
3215
4163
|
'application/json': {
|
|
4164
|
+
/** @description The queued job's ID. Check its progress with `GET .../jobs/{jobId}`. */
|
|
3216
4165
|
jobId: string;
|
|
3217
4166
|
};
|
|
3218
4167
|
};
|
|
@@ -3224,59 +4173,98 @@ interface operations {
|
|
|
3224
4173
|
query?: never;
|
|
3225
4174
|
header?: never;
|
|
3226
4175
|
path: {
|
|
4176
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
3227
4177
|
knowledgeBaseId: string;
|
|
4178
|
+
/** @description The import's ID. */
|
|
3228
4179
|
importId: string;
|
|
3229
4180
|
};
|
|
3230
4181
|
cookie?: never;
|
|
3231
4182
|
};
|
|
3232
4183
|
requestBody?: never;
|
|
3233
4184
|
responses: {
|
|
3234
|
-
/** @description
|
|
4185
|
+
/** @description Content added to a knowledge base: a file upload, website crawl, Sanity dataset, or inline text. */
|
|
3235
4186
|
200: {
|
|
3236
4187
|
headers: {
|
|
3237
4188
|
[name: string]: unknown;
|
|
3238
4189
|
};
|
|
3239
4190
|
content: {
|
|
3240
4191
|
'application/json': {
|
|
3241
|
-
/**
|
|
4192
|
+
/**
|
|
4193
|
+
* Format: uuid
|
|
4194
|
+
* @description The import's ID.
|
|
4195
|
+
*/
|
|
3242
4196
|
id: string;
|
|
3243
|
-
/**
|
|
4197
|
+
/**
|
|
4198
|
+
* Format: uuid
|
|
4199
|
+
* @description The `id` of the knowledge base that the import belongs to.
|
|
4200
|
+
*/
|
|
3244
4201
|
knowledgeBaseId: string;
|
|
4202
|
+
/** @description A label for the import: the file name for an upload, the root URL for a crawl, a label for a dataset query, or the title for inline text. */
|
|
3245
4203
|
name: string | null;
|
|
4204
|
+
/** @description The size of the uploaded file or inline text, in bytes. `null` for crawl and dataset imports, and until a file upload completes. */
|
|
3246
4205
|
sizeBytes: number | null;
|
|
3247
|
-
/**
|
|
4206
|
+
/**
|
|
4207
|
+
* @description The import's status. `uploading`: waiting for the file upload to complete. `processing`: content is being fetched and processed. `complete`: processing finished. `failed`: the import, or at least one of its sources, couldn't be processed. See `statusDetail` and `error` for details.
|
|
4208
|
+
* @enum {string}
|
|
4209
|
+
*/
|
|
3248
4210
|
status: 'uploading' | 'processing' | 'complete' | 'failed';
|
|
3249
|
-
/**
|
|
4211
|
+
/**
|
|
4212
|
+
* @description The kind of sources the import produces. `file`: uploads and inline text. `web`: crawls. `dataset`: Sanity datasets.
|
|
4213
|
+
* @enum {string}
|
|
4214
|
+
*/
|
|
3250
4215
|
sourceKind: 'web' | 'file' | 'dataset';
|
|
3251
|
-
/**
|
|
4216
|
+
/**
|
|
4217
|
+
* Format: date-time
|
|
4218
|
+
* @description When the import's website or dataset was last checked, even if nothing changed. `null` for file and text imports, and before the first check.
|
|
4219
|
+
*/
|
|
3252
4220
|
lastCheckedAt: string | null;
|
|
4221
|
+
/** @description The number of sources the import produced, such as crawled pages or files in an archive. Doesn't count parts split from large sources. */
|
|
3253
4222
|
sourceCount: number;
|
|
4223
|
+
/** @description The number of sources expected to be distilled, including parts split from large sources. Excludes skipped sources. */
|
|
3254
4224
|
totalDistillableCount: number;
|
|
4225
|
+
/** @description The number of sources distilled so far. Compare it with `totalDistillableCount` to show progress. */
|
|
3255
4226
|
distilledCount: number;
|
|
4227
|
+
/** @description The number of sources skipped because their file type isn't supported, such as images. */
|
|
3256
4228
|
unsupportedCount: number;
|
|
4229
|
+
/** @description A note about the import's outcome, written to show to users. It explains a failure or a partial result, such as a crawl that stopped at the source limit. `null` when there's nothing to note. Prefer it over `error`. */
|
|
3257
4230
|
statusDetail: string | null;
|
|
4231
|
+
/** @description When `status` is `failed`, a readable reason from one failed source. `null` for any other status, or when no single source failed. */
|
|
3258
4232
|
error: string | null;
|
|
3259
|
-
/** @description
|
|
4233
|
+
/** @description The options the next crawl of this website uses. An empty object means the defaults. `null` for other import types, and for a crawl whose root URL was removed. */
|
|
3260
4234
|
crawlOptions: {
|
|
4235
|
+
/** @description Regular expressions for URL paths to crawl. When set, the crawl only includes pages whose path matches one of them. */
|
|
3261
4236
|
includePaths?: string[];
|
|
4237
|
+
/** @description Regular expressions for URL paths to skip. Pages whose path matches one of them aren't crawled. */
|
|
3262
4238
|
excludePaths?: string[];
|
|
4239
|
+
/** @description How many levels deep the crawl goes from the root URL. */
|
|
3263
4240
|
maxDepth?: number;
|
|
4241
|
+
/** @description Whether to crawl only the pages listed in the site's sitemap. */
|
|
3264
4242
|
sitemapOnly?: boolean;
|
|
4243
|
+
/** @description Whether to treat URLs that differ only by query string as one page. New crawls set it to `true` unless you set it. Set it to `false` when the query string selects different content, such as pagination. */
|
|
3265
4244
|
ignoreQueryParameters?: boolean;
|
|
4245
|
+
/** @description The maximum number of pages to crawl. The crawl can stop sooner when the knowledge base reaches its source limit. */
|
|
3266
4246
|
pageLimit?: number;
|
|
3267
4247
|
} | null;
|
|
3268
|
-
/** @description
|
|
4248
|
+
/** @description The Sanity project, dataset, and full query a dataset import reads from. `null` for other import types. */
|
|
3269
4249
|
datasetSource: {
|
|
4250
|
+
/** @description The ID of the Sanity project the documents come from. */
|
|
3270
4251
|
sanityProjectId: string;
|
|
4252
|
+
/** @description The dataset the documents come from. */
|
|
3271
4253
|
sanityDatasetId: string;
|
|
4254
|
+
/** @description The full GROQ query that selects the documents, exactly as saved. */
|
|
3272
4255
|
query: string;
|
|
3273
4256
|
} | null;
|
|
3274
|
-
/** @description
|
|
4257
|
+
/** @description Who added the import. `null` if unknown. */
|
|
3275
4258
|
createdBy: {
|
|
4259
|
+
/** @description The Sanity user ID, or `sanity-system` when Sanity Context made the change. `null` if unknown. */
|
|
3276
4260
|
id: string | null;
|
|
4261
|
+
/** @description The user's name when the action happened. `null` if unknown. For the current name, look up the user by `id`. */
|
|
3277
4262
|
displayName: string | null;
|
|
3278
4263
|
} | null;
|
|
3279
|
-
/**
|
|
4264
|
+
/**
|
|
4265
|
+
* Format: date-time
|
|
4266
|
+
* @description When the import was created.
|
|
4267
|
+
*/
|
|
3280
4268
|
createdAt: string;
|
|
3281
4269
|
/** Format: date-time */
|
|
3282
4270
|
completedAt: string | null;
|
|
@@ -3290,14 +4278,16 @@ interface operations {
|
|
|
3290
4278
|
query?: never;
|
|
3291
4279
|
header?: never;
|
|
3292
4280
|
path: {
|
|
4281
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
3293
4282
|
knowledgeBaseId: string;
|
|
4283
|
+
/** @description The import's ID. */
|
|
3294
4284
|
importId: string;
|
|
3295
4285
|
};
|
|
3296
4286
|
cookie?: never;
|
|
3297
4287
|
};
|
|
3298
4288
|
requestBody?: never;
|
|
3299
4289
|
responses: {
|
|
3300
|
-
/** @description
|
|
4290
|
+
/** @description The import and its sources were deleted. */
|
|
3301
4291
|
204: {
|
|
3302
4292
|
headers: {
|
|
3303
4293
|
[name: string]: unknown;
|
|
@@ -3313,23 +4303,31 @@ interface operations {
|
|
|
3313
4303
|
query?: never;
|
|
3314
4304
|
header?: never;
|
|
3315
4305
|
path: {
|
|
4306
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
3316
4307
|
knowledgeBaseId: string;
|
|
4308
|
+
/** @description The import's ID. */
|
|
3317
4309
|
importId: string;
|
|
3318
4310
|
};
|
|
3319
4311
|
cookie?: never;
|
|
3320
4312
|
};
|
|
3321
4313
|
requestBody?: never;
|
|
3322
4314
|
responses: {
|
|
3323
|
-
/** @description
|
|
4315
|
+
/** @description A short-lived URL that downloads the import's original content. */
|
|
3324
4316
|
200: {
|
|
3325
4317
|
headers: {
|
|
3326
4318
|
[name: string]: unknown;
|
|
3327
4319
|
};
|
|
3328
4320
|
content: {
|
|
3329
4321
|
'application/json': {
|
|
3330
|
-
/**
|
|
4322
|
+
/**
|
|
4323
|
+
* Format: uri
|
|
4324
|
+
* @description A signed URL that downloads the import's original content as a file.
|
|
4325
|
+
*/
|
|
3331
4326
|
url: string;
|
|
3332
|
-
/**
|
|
4327
|
+
/**
|
|
4328
|
+
* Format: date-time
|
|
4329
|
+
* @description When `url` expires, 10 minutes after the request.
|
|
4330
|
+
*/
|
|
3333
4331
|
expiresAt: string;
|
|
3334
4332
|
};
|
|
3335
4333
|
};
|
|
@@ -3341,58 +4339,89 @@ interface operations {
|
|
|
3341
4339
|
query?: never;
|
|
3342
4340
|
header?: never;
|
|
3343
4341
|
path: {
|
|
4342
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
3344
4343
|
knowledgeBaseId: string;
|
|
3345
4344
|
};
|
|
3346
4345
|
cookie?: never;
|
|
3347
4346
|
};
|
|
3348
|
-
/** @description
|
|
4347
|
+
/** @description The instruction to create, and any entries to rebuild under it. */
|
|
3349
4348
|
requestBody: {
|
|
3350
4349
|
content: {
|
|
3351
4350
|
'application/json': {
|
|
4351
|
+
/** @description The instruction in plain language. Builds follow it over what the sources say. */
|
|
3352
4352
|
statement: string;
|
|
3353
|
-
|
|
4353
|
+
/** @description IDs of the sources the instruction applies to. Builds apply it when they write entries that cite these sources. IDs of sources that no longer exist are dropped. If none exist, the request returns `422` with code `instructionScopeVanished`. */
|
|
4354
|
+
scopeSourceIds: string[];
|
|
4355
|
+
/** @description Paths of entries to rebuild under the new instruction right away. The response returns the rebuild job ID in `rebuildJobId`. */
|
|
3354
4356
|
rebuildPaths?: string[];
|
|
4357
|
+
/** @description Whether you already checked the instruction for entries that contradict it. When `true`, the background check that files issues for those entries is skipped. It still runs if the rebuild you requested in `rebuildPaths` does not start. */
|
|
3355
4358
|
verified?: boolean;
|
|
3356
4359
|
};
|
|
3357
4360
|
};
|
|
3358
4361
|
};
|
|
3359
4362
|
responses: {
|
|
3360
|
-
/** @description
|
|
4363
|
+
/** @description The created instruction, and the rebuild it started. */
|
|
3361
4364
|
201: {
|
|
3362
4365
|
headers: {
|
|
3363
4366
|
[name: string]: unknown;
|
|
3364
4367
|
};
|
|
3365
4368
|
content: {
|
|
3366
4369
|
'application/json': {
|
|
3367
|
-
/** @description
|
|
4370
|
+
/** @description The created instruction. */
|
|
3368
4371
|
instruction: {
|
|
4372
|
+
/** @description The instruction's document ID. */
|
|
3369
4373
|
id: string;
|
|
4374
|
+
/** @description ID of the knowledge base the instruction belongs to. */
|
|
3370
4375
|
knowledgeBaseId: string;
|
|
3371
|
-
/**
|
|
4376
|
+
/**
|
|
4377
|
+
* @description How the instruction was created. `human`: someone wrote it. `conflict`: it records the side chosen when a conflict issue was resolved. Both kinds work the same way in builds.
|
|
4378
|
+
* @enum {string}
|
|
4379
|
+
*/
|
|
3372
4380
|
origin: 'conflict' | 'human';
|
|
3373
|
-
/**
|
|
4381
|
+
/**
|
|
4382
|
+
* @description Whether builds apply the instruction. `active`: builds apply it. `archived`: a refresh found that its sources no longer support it, so builds stop applying it. To reactivate an archived instruction, update it.
|
|
4383
|
+
* @enum {string}
|
|
4384
|
+
*/
|
|
3374
4385
|
status: 'active' | 'archived';
|
|
4386
|
+
/** @description The instruction in plain language. Builds follow it over what the sources say. */
|
|
3375
4387
|
statement: string;
|
|
3376
|
-
|
|
3377
|
-
|
|
4388
|
+
/** @description IDs of the sources the instruction applies to. Builds apply it when they write entries that cite these sources. An empty array means all of its sources were removed, so it applies to no entries. */
|
|
4389
|
+
scopeSourceIds: string[];
|
|
4390
|
+
/**
|
|
4391
|
+
* Format: date-time
|
|
4392
|
+
* @description When a refresh archived the instruction. `null` while it is active.
|
|
4393
|
+
*/
|
|
3378
4394
|
archivedAt: string | null;
|
|
4395
|
+
/** @description Why the instruction was archived. `null` while it is active. */
|
|
3379
4396
|
archivedReason: string | null;
|
|
4397
|
+
/** @description ID of the conflict issue this instruction records. `null` when `origin` is `human`. */
|
|
3380
4398
|
sourceIssueId: string | null;
|
|
3381
|
-
/** @description
|
|
4399
|
+
/** @description Who created the instruction. `null` for instructions created by resolving a conflict, and when the creator is unknown. */
|
|
3382
4400
|
createdBy: {
|
|
4401
|
+
/** @description The Sanity user ID, or `sanity-system` when Sanity Context made the change. `null` if unknown. */
|
|
3383
4402
|
id: string | null;
|
|
4403
|
+
/** @description The user's name when the action happened. `null` if unknown. For the current name, look up the user by `id`. */
|
|
3384
4404
|
displayName: string | null;
|
|
3385
4405
|
} | null;
|
|
3386
|
-
/** @description
|
|
4406
|
+
/** @description Who last updated the instruction through the API. `null` when it was never updated, or when the person is unknown. */
|
|
3387
4407
|
updatedBy: {
|
|
4408
|
+
/** @description The Sanity user ID, or `sanity-system` when Sanity Context made the change. `null` if unknown. */
|
|
3388
4409
|
id: string | null;
|
|
4410
|
+
/** @description The user's name when the action happened. `null` if unknown. For the current name, look up the user by `id`. */
|
|
3389
4411
|
displayName: string | null;
|
|
3390
4412
|
} | null;
|
|
3391
|
-
/**
|
|
4413
|
+
/**
|
|
4414
|
+
* Format: date-time
|
|
4415
|
+
* @description When the instruction was created.
|
|
4416
|
+
*/
|
|
3392
4417
|
createdAt: string;
|
|
3393
|
-
/**
|
|
4418
|
+
/**
|
|
4419
|
+
* Format: date-time
|
|
4420
|
+
* @description When the instruction last changed, including changes a refresh makes. `null` when the time is unknown.
|
|
4421
|
+
*/
|
|
3394
4422
|
updatedAt: string | null;
|
|
3395
4423
|
};
|
|
4424
|
+
/** @description ID of the job that rebuilds the entries in `rebuildPaths`. Poll it with `GET .../jobs/{jobId}`. `null` when you didn't pass `rebuildPaths` or the rebuild could not start. The instruction is saved either way. */
|
|
3396
4425
|
rebuildJobId: string | null;
|
|
3397
4426
|
};
|
|
3398
4427
|
};
|
|
@@ -3404,14 +4433,16 @@ interface operations {
|
|
|
3404
4433
|
query?: never;
|
|
3405
4434
|
header?: never;
|
|
3406
4435
|
path: {
|
|
4436
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
3407
4437
|
knowledgeBaseId: string;
|
|
4438
|
+
/** @description The instruction's ID. */
|
|
3408
4439
|
instructionId: string;
|
|
3409
4440
|
};
|
|
3410
4441
|
cookie?: never;
|
|
3411
4442
|
};
|
|
3412
4443
|
requestBody?: never;
|
|
3413
4444
|
responses: {
|
|
3414
|
-
/** @description
|
|
4445
|
+
/** @description The instruction was deleted. */
|
|
3415
4446
|
204: {
|
|
3416
4447
|
headers: {
|
|
3417
4448
|
[name: string]: unknown;
|
|
@@ -3427,53 +4458,82 @@ interface operations {
|
|
|
3427
4458
|
query?: never;
|
|
3428
4459
|
header?: never;
|
|
3429
4460
|
path: {
|
|
4461
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
3430
4462
|
knowledgeBaseId: string;
|
|
4463
|
+
/** @description The instruction's ID. */
|
|
3431
4464
|
instructionId: string;
|
|
3432
4465
|
};
|
|
3433
4466
|
cookie?: never;
|
|
3434
4467
|
};
|
|
3435
|
-
/** @description
|
|
4468
|
+
/** @description The changes to make to an instruction. Set `statement`, `scopeSourceIds`, or both. Any update also reactivates an archived instruction. */
|
|
3436
4469
|
requestBody: {
|
|
3437
4470
|
content: {
|
|
3438
4471
|
'application/json': {
|
|
4472
|
+
/** @description The new instruction text. Omit it to keep the current text. */
|
|
3439
4473
|
statement?: string;
|
|
3440
|
-
|
|
4474
|
+
/** @description IDs of the sources the instruction applies to. Replaces the current list. Omit it to keep the current sources. IDs of sources that no longer exist are dropped. If none exist, the request returns `422` with code `instructionScopeVanished`. */
|
|
4475
|
+
scopeSourceIds?: string[];
|
|
3441
4476
|
};
|
|
3442
4477
|
};
|
|
3443
4478
|
};
|
|
3444
4479
|
responses: {
|
|
3445
|
-
/** @description
|
|
4480
|
+
/** @description A standing instruction that shapes how entries that cite its sources are written. */
|
|
3446
4481
|
200: {
|
|
3447
4482
|
headers: {
|
|
3448
4483
|
[name: string]: unknown;
|
|
3449
4484
|
};
|
|
3450
4485
|
content: {
|
|
3451
4486
|
'application/json': {
|
|
4487
|
+
/** @description The instruction's document ID. */
|
|
3452
4488
|
id: string;
|
|
4489
|
+
/** @description ID of the knowledge base the instruction belongs to. */
|
|
3453
4490
|
knowledgeBaseId: string;
|
|
3454
|
-
/**
|
|
4491
|
+
/**
|
|
4492
|
+
* @description How the instruction was created. `human`: someone wrote it. `conflict`: it records the side chosen when a conflict issue was resolved. Both kinds work the same way in builds.
|
|
4493
|
+
* @enum {string}
|
|
4494
|
+
*/
|
|
3455
4495
|
origin: 'conflict' | 'human';
|
|
3456
|
-
/**
|
|
4496
|
+
/**
|
|
4497
|
+
* @description Whether builds apply the instruction. `active`: builds apply it. `archived`: a refresh found that its sources no longer support it, so builds stop applying it. To reactivate an archived instruction, update it.
|
|
4498
|
+
* @enum {string}
|
|
4499
|
+
*/
|
|
3457
4500
|
status: 'active' | 'archived';
|
|
4501
|
+
/** @description The instruction in plain language. Builds follow it over what the sources say. */
|
|
3458
4502
|
statement: string;
|
|
3459
|
-
|
|
3460
|
-
|
|
4503
|
+
/** @description IDs of the sources the instruction applies to. Builds apply it when they write entries that cite these sources. An empty array means all of its sources were removed, so it applies to no entries. */
|
|
4504
|
+
scopeSourceIds: string[];
|
|
4505
|
+
/**
|
|
4506
|
+
* Format: date-time
|
|
4507
|
+
* @description When a refresh archived the instruction. `null` while it is active.
|
|
4508
|
+
*/
|
|
3461
4509
|
archivedAt: string | null;
|
|
4510
|
+
/** @description Why the instruction was archived. `null` while it is active. */
|
|
3462
4511
|
archivedReason: string | null;
|
|
4512
|
+
/** @description ID of the conflict issue this instruction records. `null` when `origin` is `human`. */
|
|
3463
4513
|
sourceIssueId: string | null;
|
|
3464
|
-
/** @description
|
|
4514
|
+
/** @description Who created the instruction. `null` for instructions created by resolving a conflict, and when the creator is unknown. */
|
|
3465
4515
|
createdBy: {
|
|
4516
|
+
/** @description The Sanity user ID, or `sanity-system` when Sanity Context made the change. `null` if unknown. */
|
|
3466
4517
|
id: string | null;
|
|
4518
|
+
/** @description The user's name when the action happened. `null` if unknown. For the current name, look up the user by `id`. */
|
|
3467
4519
|
displayName: string | null;
|
|
3468
4520
|
} | null;
|
|
3469
|
-
/** @description
|
|
4521
|
+
/** @description Who last updated the instruction through the API. `null` when it was never updated, or when the person is unknown. */
|
|
3470
4522
|
updatedBy: {
|
|
4523
|
+
/** @description The Sanity user ID, or `sanity-system` when Sanity Context made the change. `null` if unknown. */
|
|
3471
4524
|
id: string | null;
|
|
4525
|
+
/** @description The user's name when the action happened. `null` if unknown. For the current name, look up the user by `id`. */
|
|
3472
4526
|
displayName: string | null;
|
|
3473
4527
|
} | null;
|
|
3474
|
-
/**
|
|
4528
|
+
/**
|
|
4529
|
+
* Format: date-time
|
|
4530
|
+
* @description When the instruction was created.
|
|
4531
|
+
*/
|
|
3475
4532
|
createdAt: string;
|
|
3476
|
-
/**
|
|
4533
|
+
/**
|
|
4534
|
+
* Format: date-time
|
|
4535
|
+
* @description When the instruction last changed, including changes a refresh makes. `null` when the time is unknown.
|
|
4536
|
+
*/
|
|
3477
4537
|
updatedAt: string | null;
|
|
3478
4538
|
};
|
|
3479
4539
|
};
|
|
@@ -3485,6 +4545,7 @@ interface operations {
|
|
|
3485
4545
|
query?: never;
|
|
3486
4546
|
header?: never;
|
|
3487
4547
|
path: {
|
|
4548
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
3488
4549
|
knowledgeBaseId: string;
|
|
3489
4550
|
};
|
|
3490
4551
|
cookie?: never;
|
|
@@ -3492,18 +4553,20 @@ interface operations {
|
|
|
3492
4553
|
requestBody: {
|
|
3493
4554
|
content: {
|
|
3494
4555
|
'application/json': {
|
|
4556
|
+
/** @description The IDs of the issues to accept and apply. */
|
|
3495
4557
|
issueIds: string[];
|
|
3496
4558
|
};
|
|
3497
4559
|
};
|
|
3498
4560
|
};
|
|
3499
4561
|
responses: {
|
|
3500
|
-
/** @description
|
|
4562
|
+
/** @description A queued job that you can poll for progress. */
|
|
3501
4563
|
202: {
|
|
3502
4564
|
headers: {
|
|
3503
4565
|
[name: string]: unknown;
|
|
3504
4566
|
};
|
|
3505
4567
|
content: {
|
|
3506
4568
|
'application/json': {
|
|
4569
|
+
/** @description The queued job's ID. Check its progress with `GET .../jobs/{jobId}`. */
|
|
3507
4570
|
jobId: string;
|
|
3508
4571
|
};
|
|
3509
4572
|
};
|
|
@@ -3515,56 +4578,123 @@ interface operations {
|
|
|
3515
4578
|
query?: never;
|
|
3516
4579
|
header?: never;
|
|
3517
4580
|
path: {
|
|
4581
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
3518
4582
|
knowledgeBaseId: string;
|
|
4583
|
+
/** @description The issue's document ID. */
|
|
3519
4584
|
issueId: string;
|
|
3520
4585
|
};
|
|
3521
4586
|
cookie?: never;
|
|
3522
4587
|
};
|
|
3523
4588
|
requestBody?: never;
|
|
3524
4589
|
responses: {
|
|
3525
|
-
/** @description
|
|
4590
|
+
/** @description An issue found in a knowledge base, and its triage status. */
|
|
3526
4591
|
200: {
|
|
3527
4592
|
headers: {
|
|
3528
4593
|
[name: string]: unknown;
|
|
3529
4594
|
};
|
|
3530
4595
|
content: {
|
|
3531
4596
|
'application/json': {
|
|
4597
|
+
/** @description The issue's document ID. A later build that finds the same issue in unchanged sources reuses this ID, so your triage decision is kept. */
|
|
3532
4598
|
id: string;
|
|
4599
|
+
/** @description ID of the knowledge base the issue belongs to. */
|
|
3533
4600
|
knowledgeBaseId: string;
|
|
3534
|
-
/** @description
|
|
4601
|
+
/** @description What the issue found. The shape depends on `kind`. */
|
|
3535
4602
|
content: {
|
|
3536
|
-
/**
|
|
3537
|
-
|
|
3538
|
-
|
|
4603
|
+
/**
|
|
4604
|
+
* @description How serious the issue is. `critical`: content is wrong or missing in a way that can mislead an agent. `suggestion`: a change that improves quality.
|
|
4605
|
+
* @enum {string}
|
|
4606
|
+
*/
|
|
4607
|
+
severity: 'critical' | 'suggestion';
|
|
4608
|
+
/** @description Path of the entry the issue is about, or `*` when it applies to the whole knowledge base. For `add_entry`, the path of the proposed entry. */
|
|
4609
|
+
scopePath: string;
|
|
4610
|
+
/** @description What the problem is, in one or two sentences. */
|
|
4611
|
+
issue: string;
|
|
4612
|
+
/** @description What to do to fix the issue. */
|
|
4613
|
+
suggestedFix: string;
|
|
4614
|
+
/**
|
|
4615
|
+
* @description The issue type. `conflict` means two or more positions disagree on the same fact, and you choose which one is correct.
|
|
4616
|
+
* @enum {string}
|
|
4617
|
+
*/
|
|
4618
|
+
kind: 'conflict';
|
|
4619
|
+
/** @description A key naming the disputed fact, such as `free_tier.request_limit`. It never includes the disputed value, so every side shares it. */
|
|
4620
|
+
claimKey: string;
|
|
4621
|
+
/** @description The conflicting positions, at least two. To resolve the conflict, pass the index of one side as `resolution`. */
|
|
4622
|
+
sides: {
|
|
4623
|
+
/** @description The position as a self-contained sentence. This is the option you choose from. */
|
|
4624
|
+
claim: string;
|
|
4625
|
+
/** @description The disputed value on its own, such as `10,000/month`, without the sentence. */
|
|
4626
|
+
value?: string;
|
|
4627
|
+
/** @description Paths of the entries that state this position. */
|
|
4628
|
+
entryPaths?: string[];
|
|
4629
|
+
/** @description IDs of the sources that directly back this position. */
|
|
4630
|
+
sourceIds?: string[];
|
|
4631
|
+
/** @description Where in a source this position was read. */
|
|
4632
|
+
span?: {
|
|
4633
|
+
/** @description ID of the source the position was read from. */
|
|
4634
|
+
sourceId: string;
|
|
4635
|
+
/** @description First line of the range, counting from 1. Line numbers match `GET .../sources/{sourceId}/content`. */
|
|
4636
|
+
lineStart: number;
|
|
4637
|
+
/** @description Last line of the range, inclusive. */
|
|
4638
|
+
lineEnd: number;
|
|
4639
|
+
};
|
|
4640
|
+
/**
|
|
4641
|
+
* @description How much weight the sources behind this position carry. `primary`: your own content, such as uploaded files and pages on your own site. `secondary`: other sources. `community`: forums and Q&A sites.
|
|
4642
|
+
* @enum {string}
|
|
4643
|
+
*/
|
|
4644
|
+
authority?: 'primary' | 'secondary' | 'community';
|
|
4645
|
+
}[];
|
|
4646
|
+
/** @description Index in `sides` of the suggested side, when there is one. It is only a hint: nothing is chosen until you resolve the issue. */
|
|
4647
|
+
suggested?: number;
|
|
4648
|
+
} | {
|
|
4649
|
+
/**
|
|
4650
|
+
* @description How serious the issue is. `critical`: content is wrong or missing in a way that can mislead an agent. `suggestion`: a change that improves quality.
|
|
4651
|
+
* @enum {string}
|
|
4652
|
+
*/
|
|
3539
4653
|
severity: 'critical' | 'suggestion';
|
|
4654
|
+
/** @description Path of the entry the issue is about, or `*` when it applies to the whole knowledge base. For `add_entry`, the path of the proposed entry. */
|
|
3540
4655
|
scopePath: string;
|
|
4656
|
+
/** @description What the problem is, in one or two sentences. */
|
|
3541
4657
|
issue: string;
|
|
4658
|
+
/** @description What to do to fix the issue. */
|
|
3542
4659
|
suggestedFix: string;
|
|
4660
|
+
/**
|
|
4661
|
+
* @description The issue type. `gap`: your sources cover material that entries leave out. `update_required`: an entry is out of date with its sources or contradicts an instruction, and needs a rewrite. `add_entry`: your sources cover a topic that no entry covers. `remove_entry`: an entry has lost its sources or its topic no longer applies. `split_entry`: an entry covers several distinct topics and should become child entries. `merge_entry`: an entry has too few sources to stand alone, so merge it into a nearby entry or keep it as it is.
|
|
4662
|
+
* @enum {string}
|
|
4663
|
+
*/
|
|
4664
|
+
kind: 'gap' | 'update_required' | 'add_entry' | 'remove_entry' | 'split_entry' | 'merge_entry';
|
|
4665
|
+
/** @description IDs of the sources that led to the issue. For `add_entry`, the sources the new entry would cite. */
|
|
3543
4666
|
citedSourceIds?: string[];
|
|
4667
|
+
/** @description A key naming the specific finding, when the check that found it sets one. */
|
|
3544
4668
|
claimKey?: string;
|
|
4669
|
+
/** @description Paths of the entries the issue involves, when it spans more than one entry. */
|
|
3545
4670
|
involvedScopes?: string[];
|
|
3546
|
-
currentClaim?: string;
|
|
3547
|
-
alternativeClaim?: string;
|
|
3548
|
-
/** @enum {string} */
|
|
3549
|
-
currentAuthority?: 'primary' | 'secondary' | 'community';
|
|
3550
|
-
/** @enum {string} */
|
|
3551
|
-
alternativeAuthority?: 'primary' | 'secondary' | 'community';
|
|
3552
|
-
/** @enum {string} */
|
|
3553
|
-
suggestedResolution?: 'keep_existing' | 'accept_new';
|
|
3554
4671
|
};
|
|
3555
|
-
/**
|
|
4672
|
+
/**
|
|
4673
|
+
* @description The triage status. `open`: waiting for triage. `accepted`: accepted with `POST .../issues/apply`, or a conflict resolved to one side. `rejected`: dismissed. A rejected issue stays rejected. You can return an accepted conflict to `open` with `POST .../issues/{issueId}/reopen`.
|
|
4674
|
+
* @enum {string}
|
|
4675
|
+
*/
|
|
3556
4676
|
status: 'open' | 'accepted' | 'rejected';
|
|
3557
|
-
/** @
|
|
3558
|
-
resolution:
|
|
3559
|
-
/** @description
|
|
4677
|
+
/** @description Index in `content.sides` of the side chosen when the conflict was resolved. For a conflict on a single entry, index `0` is the entry's current content. `null` until a conflict is resolved, and always `null` for other issue types. */
|
|
4678
|
+
resolution: number | null;
|
|
4679
|
+
/** @description Who triaged the issue, so you can review what your agents decided. `null` while the issue is open, or when the caller could not be identified. */
|
|
3560
4680
|
resolvedBy: {
|
|
4681
|
+
/** @description Sanity user ID of the person or robot that triaged the issue. */
|
|
3561
4682
|
id: string;
|
|
3562
|
-
/**
|
|
4683
|
+
/**
|
|
4684
|
+
* @description `user` when a person made the decision. `robot` when a robot token did, such as an agent.
|
|
4685
|
+
* @enum {string}
|
|
4686
|
+
*/
|
|
3563
4687
|
kind: 'user' | 'robot';
|
|
3564
4688
|
} | null;
|
|
3565
|
-
/**
|
|
4689
|
+
/**
|
|
4690
|
+
* Format: date-time
|
|
4691
|
+
* @description When the issue was first filed.
|
|
4692
|
+
*/
|
|
3566
4693
|
createdAt: string;
|
|
3567
|
-
/**
|
|
4694
|
+
/**
|
|
4695
|
+
* Format: date-time
|
|
4696
|
+
* @description When the issue left `open`. `null` while the issue is open.
|
|
4697
|
+
*/
|
|
3568
4698
|
resolvedAt: string | null;
|
|
3569
4699
|
};
|
|
3570
4700
|
};
|
|
@@ -3576,56 +4706,123 @@ interface operations {
|
|
|
3576
4706
|
query?: never;
|
|
3577
4707
|
header?: never;
|
|
3578
4708
|
path: {
|
|
4709
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
3579
4710
|
knowledgeBaseId: string;
|
|
4711
|
+
/** @description The issue's document ID. */
|
|
3580
4712
|
issueId: string;
|
|
3581
4713
|
};
|
|
3582
4714
|
cookie?: never;
|
|
3583
4715
|
};
|
|
3584
4716
|
requestBody?: never;
|
|
3585
4717
|
responses: {
|
|
3586
|
-
/** @description
|
|
4718
|
+
/** @description An issue found in a knowledge base, and its triage status. */
|
|
3587
4719
|
200: {
|
|
3588
4720
|
headers: {
|
|
3589
4721
|
[name: string]: unknown;
|
|
3590
4722
|
};
|
|
3591
4723
|
content: {
|
|
3592
4724
|
'application/json': {
|
|
4725
|
+
/** @description The issue's document ID. A later build that finds the same issue in unchanged sources reuses this ID, so your triage decision is kept. */
|
|
3593
4726
|
id: string;
|
|
4727
|
+
/** @description ID of the knowledge base the issue belongs to. */
|
|
3594
4728
|
knowledgeBaseId: string;
|
|
3595
|
-
/** @description
|
|
4729
|
+
/** @description What the issue found. The shape depends on `kind`. */
|
|
3596
4730
|
content: {
|
|
3597
|
-
/**
|
|
3598
|
-
|
|
3599
|
-
|
|
4731
|
+
/**
|
|
4732
|
+
* @description How serious the issue is. `critical`: content is wrong or missing in a way that can mislead an agent. `suggestion`: a change that improves quality.
|
|
4733
|
+
* @enum {string}
|
|
4734
|
+
*/
|
|
4735
|
+
severity: 'critical' | 'suggestion';
|
|
4736
|
+
/** @description Path of the entry the issue is about, or `*` when it applies to the whole knowledge base. For `add_entry`, the path of the proposed entry. */
|
|
4737
|
+
scopePath: string;
|
|
4738
|
+
/** @description What the problem is, in one or two sentences. */
|
|
4739
|
+
issue: string;
|
|
4740
|
+
/** @description What to do to fix the issue. */
|
|
4741
|
+
suggestedFix: string;
|
|
4742
|
+
/**
|
|
4743
|
+
* @description The issue type. `conflict` means two or more positions disagree on the same fact, and you choose which one is correct.
|
|
4744
|
+
* @enum {string}
|
|
4745
|
+
*/
|
|
4746
|
+
kind: 'conflict';
|
|
4747
|
+
/** @description A key naming the disputed fact, such as `free_tier.request_limit`. It never includes the disputed value, so every side shares it. */
|
|
4748
|
+
claimKey: string;
|
|
4749
|
+
/** @description The conflicting positions, at least two. To resolve the conflict, pass the index of one side as `resolution`. */
|
|
4750
|
+
sides: {
|
|
4751
|
+
/** @description The position as a self-contained sentence. This is the option you choose from. */
|
|
4752
|
+
claim: string;
|
|
4753
|
+
/** @description The disputed value on its own, such as `10,000/month`, without the sentence. */
|
|
4754
|
+
value?: string;
|
|
4755
|
+
/** @description Paths of the entries that state this position. */
|
|
4756
|
+
entryPaths?: string[];
|
|
4757
|
+
/** @description IDs of the sources that directly back this position. */
|
|
4758
|
+
sourceIds?: string[];
|
|
4759
|
+
/** @description Where in a source this position was read. */
|
|
4760
|
+
span?: {
|
|
4761
|
+
/** @description ID of the source the position was read from. */
|
|
4762
|
+
sourceId: string;
|
|
4763
|
+
/** @description First line of the range, counting from 1. Line numbers match `GET .../sources/{sourceId}/content`. */
|
|
4764
|
+
lineStart: number;
|
|
4765
|
+
/** @description Last line of the range, inclusive. */
|
|
4766
|
+
lineEnd: number;
|
|
4767
|
+
};
|
|
4768
|
+
/**
|
|
4769
|
+
* @description How much weight the sources behind this position carry. `primary`: your own content, such as uploaded files and pages on your own site. `secondary`: other sources. `community`: forums and Q&A sites.
|
|
4770
|
+
* @enum {string}
|
|
4771
|
+
*/
|
|
4772
|
+
authority?: 'primary' | 'secondary' | 'community';
|
|
4773
|
+
}[];
|
|
4774
|
+
/** @description Index in `sides` of the suggested side, when there is one. It is only a hint: nothing is chosen until you resolve the issue. */
|
|
4775
|
+
suggested?: number;
|
|
4776
|
+
} | {
|
|
4777
|
+
/**
|
|
4778
|
+
* @description How serious the issue is. `critical`: content is wrong or missing in a way that can mislead an agent. `suggestion`: a change that improves quality.
|
|
4779
|
+
* @enum {string}
|
|
4780
|
+
*/
|
|
3600
4781
|
severity: 'critical' | 'suggestion';
|
|
4782
|
+
/** @description Path of the entry the issue is about, or `*` when it applies to the whole knowledge base. For `add_entry`, the path of the proposed entry. */
|
|
3601
4783
|
scopePath: string;
|
|
4784
|
+
/** @description What the problem is, in one or two sentences. */
|
|
3602
4785
|
issue: string;
|
|
4786
|
+
/** @description What to do to fix the issue. */
|
|
3603
4787
|
suggestedFix: string;
|
|
4788
|
+
/**
|
|
4789
|
+
* @description The issue type. `gap`: your sources cover material that entries leave out. `update_required`: an entry is out of date with its sources or contradicts an instruction, and needs a rewrite. `add_entry`: your sources cover a topic that no entry covers. `remove_entry`: an entry has lost its sources or its topic no longer applies. `split_entry`: an entry covers several distinct topics and should become child entries. `merge_entry`: an entry has too few sources to stand alone, so merge it into a nearby entry or keep it as it is.
|
|
4790
|
+
* @enum {string}
|
|
4791
|
+
*/
|
|
4792
|
+
kind: 'gap' | 'update_required' | 'add_entry' | 'remove_entry' | 'split_entry' | 'merge_entry';
|
|
4793
|
+
/** @description IDs of the sources that led to the issue. For `add_entry`, the sources the new entry would cite. */
|
|
3604
4794
|
citedSourceIds?: string[];
|
|
4795
|
+
/** @description A key naming the specific finding, when the check that found it sets one. */
|
|
3605
4796
|
claimKey?: string;
|
|
4797
|
+
/** @description Paths of the entries the issue involves, when it spans more than one entry. */
|
|
3606
4798
|
involvedScopes?: string[];
|
|
3607
|
-
currentClaim?: string;
|
|
3608
|
-
alternativeClaim?: string;
|
|
3609
|
-
/** @enum {string} */
|
|
3610
|
-
currentAuthority?: 'primary' | 'secondary' | 'community';
|
|
3611
|
-
/** @enum {string} */
|
|
3612
|
-
alternativeAuthority?: 'primary' | 'secondary' | 'community';
|
|
3613
|
-
/** @enum {string} */
|
|
3614
|
-
suggestedResolution?: 'keep_existing' | 'accept_new';
|
|
3615
4799
|
};
|
|
3616
|
-
/**
|
|
4800
|
+
/**
|
|
4801
|
+
* @description The triage status. `open`: waiting for triage. `accepted`: accepted with `POST .../issues/apply`, or a conflict resolved to one side. `rejected`: dismissed. A rejected issue stays rejected. You can return an accepted conflict to `open` with `POST .../issues/{issueId}/reopen`.
|
|
4802
|
+
* @enum {string}
|
|
4803
|
+
*/
|
|
3617
4804
|
status: 'open' | 'accepted' | 'rejected';
|
|
3618
|
-
/** @
|
|
3619
|
-
resolution:
|
|
3620
|
-
/** @description
|
|
4805
|
+
/** @description Index in `content.sides` of the side chosen when the conflict was resolved. For a conflict on a single entry, index `0` is the entry's current content. `null` until a conflict is resolved, and always `null` for other issue types. */
|
|
4806
|
+
resolution: number | null;
|
|
4807
|
+
/** @description Who triaged the issue, so you can review what your agents decided. `null` while the issue is open, or when the caller could not be identified. */
|
|
3621
4808
|
resolvedBy: {
|
|
4809
|
+
/** @description Sanity user ID of the person or robot that triaged the issue. */
|
|
3622
4810
|
id: string;
|
|
3623
|
-
/**
|
|
4811
|
+
/**
|
|
4812
|
+
* @description `user` when a person made the decision. `robot` when a robot token did, such as an agent.
|
|
4813
|
+
* @enum {string}
|
|
4814
|
+
*/
|
|
3624
4815
|
kind: 'user' | 'robot';
|
|
3625
4816
|
} | null;
|
|
3626
|
-
/**
|
|
4817
|
+
/**
|
|
4818
|
+
* Format: date-time
|
|
4819
|
+
* @description When the issue was first filed.
|
|
4820
|
+
*/
|
|
3627
4821
|
createdAt: string;
|
|
3628
|
-
/**
|
|
4822
|
+
/**
|
|
4823
|
+
* Format: date-time
|
|
4824
|
+
* @description When the issue left `open`. `null` while the issue is open.
|
|
4825
|
+
*/
|
|
3629
4826
|
resolvedAt: string | null;
|
|
3630
4827
|
};
|
|
3631
4828
|
};
|
|
@@ -3637,7 +4834,9 @@ interface operations {
|
|
|
3637
4834
|
query?: never;
|
|
3638
4835
|
header?: never;
|
|
3639
4836
|
path: {
|
|
4837
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
3640
4838
|
knowledgeBaseId: string;
|
|
4839
|
+
/** @description The issue's document ID. */
|
|
3641
4840
|
issueId: string;
|
|
3642
4841
|
};
|
|
3643
4842
|
cookie?: never;
|
|
@@ -3645,59 +4844,125 @@ interface operations {
|
|
|
3645
4844
|
requestBody: {
|
|
3646
4845
|
content: {
|
|
3647
4846
|
'application/json': {
|
|
3648
|
-
/** @
|
|
3649
|
-
resolution:
|
|
4847
|
+
/** @description The index of the chosen side in the issue's `content.sides`. */
|
|
4848
|
+
resolution: number;
|
|
3650
4849
|
};
|
|
3651
4850
|
};
|
|
3652
4851
|
};
|
|
3653
4852
|
responses: {
|
|
3654
|
-
/** @description
|
|
4853
|
+
/** @description The resolved issue, plus the job that rewrites the entry when the decision changes it. */
|
|
3655
4854
|
200: {
|
|
3656
4855
|
headers: {
|
|
3657
4856
|
[name: string]: unknown;
|
|
3658
4857
|
};
|
|
3659
4858
|
content: {
|
|
3660
4859
|
'application/json': {
|
|
3661
|
-
/** @description
|
|
4860
|
+
/** @description The resolved conflict issue, now `accepted`. */
|
|
3662
4861
|
issue: {
|
|
4862
|
+
/** @description The issue's document ID. A later build that finds the same issue in unchanged sources reuses this ID, so your triage decision is kept. */
|
|
3663
4863
|
id: string;
|
|
4864
|
+
/** @description ID of the knowledge base the issue belongs to. */
|
|
3664
4865
|
knowledgeBaseId: string;
|
|
3665
|
-
/** @description
|
|
4866
|
+
/** @description What the issue found. The shape depends on `kind`. */
|
|
3666
4867
|
content: {
|
|
3667
|
-
/**
|
|
3668
|
-
|
|
3669
|
-
|
|
4868
|
+
/**
|
|
4869
|
+
* @description How serious the issue is. `critical`: content is wrong or missing in a way that can mislead an agent. `suggestion`: a change that improves quality.
|
|
4870
|
+
* @enum {string}
|
|
4871
|
+
*/
|
|
4872
|
+
severity: 'critical' | 'suggestion';
|
|
4873
|
+
/** @description Path of the entry the issue is about, or `*` when it applies to the whole knowledge base. For `add_entry`, the path of the proposed entry. */
|
|
4874
|
+
scopePath: string;
|
|
4875
|
+
/** @description What the problem is, in one or two sentences. */
|
|
4876
|
+
issue: string;
|
|
4877
|
+
/** @description What to do to fix the issue. */
|
|
4878
|
+
suggestedFix: string;
|
|
4879
|
+
/**
|
|
4880
|
+
* @description The issue type. `conflict` means two or more positions disagree on the same fact, and you choose which one is correct.
|
|
4881
|
+
* @enum {string}
|
|
4882
|
+
*/
|
|
4883
|
+
kind: 'conflict';
|
|
4884
|
+
/** @description A key naming the disputed fact, such as `free_tier.request_limit`. It never includes the disputed value, so every side shares it. */
|
|
4885
|
+
claimKey: string;
|
|
4886
|
+
/** @description The conflicting positions, at least two. To resolve the conflict, pass the index of one side as `resolution`. */
|
|
4887
|
+
sides: {
|
|
4888
|
+
/** @description The position as a self-contained sentence. This is the option you choose from. */
|
|
4889
|
+
claim: string;
|
|
4890
|
+
/** @description The disputed value on its own, such as `10,000/month`, without the sentence. */
|
|
4891
|
+
value?: string;
|
|
4892
|
+
/** @description Paths of the entries that state this position. */
|
|
4893
|
+
entryPaths?: string[];
|
|
4894
|
+
/** @description IDs of the sources that directly back this position. */
|
|
4895
|
+
sourceIds?: string[];
|
|
4896
|
+
/** @description Where in a source this position was read. */
|
|
4897
|
+
span?: {
|
|
4898
|
+
/** @description ID of the source the position was read from. */
|
|
4899
|
+
sourceId: string;
|
|
4900
|
+
/** @description First line of the range, counting from 1. Line numbers match `GET .../sources/{sourceId}/content`. */
|
|
4901
|
+
lineStart: number;
|
|
4902
|
+
/** @description Last line of the range, inclusive. */
|
|
4903
|
+
lineEnd: number;
|
|
4904
|
+
};
|
|
4905
|
+
/**
|
|
4906
|
+
* @description How much weight the sources behind this position carry. `primary`: your own content, such as uploaded files and pages on your own site. `secondary`: other sources. `community`: forums and Q&A sites.
|
|
4907
|
+
* @enum {string}
|
|
4908
|
+
*/
|
|
4909
|
+
authority?: 'primary' | 'secondary' | 'community';
|
|
4910
|
+
}[];
|
|
4911
|
+
/** @description Index in `sides` of the suggested side, when there is one. It is only a hint: nothing is chosen until you resolve the issue. */
|
|
4912
|
+
suggested?: number;
|
|
4913
|
+
} | {
|
|
4914
|
+
/**
|
|
4915
|
+
* @description How serious the issue is. `critical`: content is wrong or missing in a way that can mislead an agent. `suggestion`: a change that improves quality.
|
|
4916
|
+
* @enum {string}
|
|
4917
|
+
*/
|
|
3670
4918
|
severity: 'critical' | 'suggestion';
|
|
4919
|
+
/** @description Path of the entry the issue is about, or `*` when it applies to the whole knowledge base. For `add_entry`, the path of the proposed entry. */
|
|
3671
4920
|
scopePath: string;
|
|
4921
|
+
/** @description What the problem is, in one or two sentences. */
|
|
3672
4922
|
issue: string;
|
|
4923
|
+
/** @description What to do to fix the issue. */
|
|
3673
4924
|
suggestedFix: string;
|
|
4925
|
+
/**
|
|
4926
|
+
* @description The issue type. `gap`: your sources cover material that entries leave out. `update_required`: an entry is out of date with its sources or contradicts an instruction, and needs a rewrite. `add_entry`: your sources cover a topic that no entry covers. `remove_entry`: an entry has lost its sources or its topic no longer applies. `split_entry`: an entry covers several distinct topics and should become child entries. `merge_entry`: an entry has too few sources to stand alone, so merge it into a nearby entry or keep it as it is.
|
|
4927
|
+
* @enum {string}
|
|
4928
|
+
*/
|
|
4929
|
+
kind: 'gap' | 'update_required' | 'add_entry' | 'remove_entry' | 'split_entry' | 'merge_entry';
|
|
4930
|
+
/** @description IDs of the sources that led to the issue. For `add_entry`, the sources the new entry would cite. */
|
|
3674
4931
|
citedSourceIds?: string[];
|
|
4932
|
+
/** @description A key naming the specific finding, when the check that found it sets one. */
|
|
3675
4933
|
claimKey?: string;
|
|
4934
|
+
/** @description Paths of the entries the issue involves, when it spans more than one entry. */
|
|
3676
4935
|
involvedScopes?: string[];
|
|
3677
|
-
currentClaim?: string;
|
|
3678
|
-
alternativeClaim?: string;
|
|
3679
|
-
/** @enum {string} */
|
|
3680
|
-
currentAuthority?: 'primary' | 'secondary' | 'community';
|
|
3681
|
-
/** @enum {string} */
|
|
3682
|
-
alternativeAuthority?: 'primary' | 'secondary' | 'community';
|
|
3683
|
-
/** @enum {string} */
|
|
3684
|
-
suggestedResolution?: 'keep_existing' | 'accept_new';
|
|
3685
4936
|
};
|
|
3686
|
-
/**
|
|
4937
|
+
/**
|
|
4938
|
+
* @description The triage status. `open`: waiting for triage. `accepted`: accepted with `POST .../issues/apply`, or a conflict resolved to one side. `rejected`: dismissed. A rejected issue stays rejected. You can return an accepted conflict to `open` with `POST .../issues/{issueId}/reopen`.
|
|
4939
|
+
* @enum {string}
|
|
4940
|
+
*/
|
|
3687
4941
|
status: 'open' | 'accepted' | 'rejected';
|
|
3688
|
-
/** @
|
|
3689
|
-
resolution:
|
|
3690
|
-
/** @description
|
|
4942
|
+
/** @description Index in `content.sides` of the side chosen when the conflict was resolved. For a conflict on a single entry, index `0` is the entry's current content. `null` until a conflict is resolved, and always `null` for other issue types. */
|
|
4943
|
+
resolution: number | null;
|
|
4944
|
+
/** @description Who triaged the issue, so you can review what your agents decided. `null` while the issue is open, or when the caller could not be identified. */
|
|
3691
4945
|
resolvedBy: {
|
|
4946
|
+
/** @description Sanity user ID of the person or robot that triaged the issue. */
|
|
3692
4947
|
id: string;
|
|
3693
|
-
/**
|
|
4948
|
+
/**
|
|
4949
|
+
* @description `user` when a person made the decision. `robot` when a robot token did, such as an agent.
|
|
4950
|
+
* @enum {string}
|
|
4951
|
+
*/
|
|
3694
4952
|
kind: 'user' | 'robot';
|
|
3695
4953
|
} | null;
|
|
3696
|
-
/**
|
|
4954
|
+
/**
|
|
4955
|
+
* Format: date-time
|
|
4956
|
+
* @description When the issue was first filed.
|
|
4957
|
+
*/
|
|
3697
4958
|
createdAt: string;
|
|
3698
|
-
/**
|
|
4959
|
+
/**
|
|
4960
|
+
* Format: date-time
|
|
4961
|
+
* @description When the issue left `open`. `null` while the issue is open.
|
|
4962
|
+
*/
|
|
3699
4963
|
resolvedAt: string | null;
|
|
3700
4964
|
};
|
|
4965
|
+
/** @description ID of the job that rewrites the entry to match the chosen side. Poll it with `GET .../jobs/{jobId}`. `null` when nothing is rewritten: you chose index `0`, or the conflict applies to the whole knowledge base. */
|
|
3701
4966
|
jobId: string | null;
|
|
3702
4967
|
};
|
|
3703
4968
|
};
|
|
@@ -3709,28 +4974,42 @@ interface operations {
|
|
|
3709
4974
|
query?: never;
|
|
3710
4975
|
header?: never;
|
|
3711
4976
|
path: {
|
|
4977
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
3712
4978
|
knowledgeBaseId: string;
|
|
4979
|
+
/** @description The job ID returned by the endpoint that started the work. */
|
|
3713
4980
|
jobId: string;
|
|
3714
4981
|
};
|
|
3715
4982
|
cookie?: never;
|
|
3716
4983
|
};
|
|
3717
4984
|
requestBody?: never;
|
|
3718
4985
|
responses: {
|
|
3719
|
-
/** @description
|
|
4986
|
+
/** @description A background job, such as a build, refresh, or import, and its status. */
|
|
3720
4987
|
200: {
|
|
3721
4988
|
headers: {
|
|
3722
4989
|
[name: string]: unknown;
|
|
3723
4990
|
};
|
|
3724
4991
|
content: {
|
|
3725
4992
|
'application/json': {
|
|
4993
|
+
/** @description The job's ID. */
|
|
3726
4994
|
id: string;
|
|
3727
|
-
/**
|
|
4995
|
+
/**
|
|
4996
|
+
* @description The job's status. `queued`: waiting for build capacity. `running`: in progress. `succeeded`: finished successfully. `failed`: stopped with an error. `cancelled`: stopped before it finished. `pending` isn't currently returned.
|
|
4997
|
+
* @enum {string}
|
|
4998
|
+
*/
|
|
3728
4999
|
status: 'pending' | 'queued' | 'running' | 'succeeded' | 'failed' | 'cancelled';
|
|
3729
|
-
/**
|
|
5000
|
+
/**
|
|
5001
|
+
* Format: date-time
|
|
5002
|
+
* @description When the job started.
|
|
5003
|
+
*/
|
|
3730
5004
|
startedAt: string | null;
|
|
3731
|
-
/**
|
|
5005
|
+
/**
|
|
5006
|
+
* Format: date-time
|
|
5007
|
+
* @description When the job finished. `null` while the job is queued or running.
|
|
5008
|
+
*/
|
|
3732
5009
|
completedAt: string | null;
|
|
5010
|
+
/** @description The job's output. Only present when `status` is `succeeded`. Its shape depends on the kind of job. */
|
|
3733
5011
|
result?: unknown;
|
|
5012
|
+
/** @description A readable reason the job failed or was cancelled. `null` for any other status. */
|
|
3734
5013
|
error?: string | null;
|
|
3735
5014
|
};
|
|
3736
5015
|
};
|
|
@@ -3742,20 +5021,23 @@ interface operations {
|
|
|
3742
5021
|
query?: never;
|
|
3743
5022
|
header?: never;
|
|
3744
5023
|
path: {
|
|
5024
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
3745
5025
|
knowledgeBaseId: string;
|
|
3746
5026
|
};
|
|
3747
5027
|
cookie?: never;
|
|
3748
5028
|
};
|
|
3749
5029
|
requestBody?: never;
|
|
3750
5030
|
responses: {
|
|
3751
|
-
/** @description
|
|
5031
|
+
/** @description A queued refresh job that you can poll for progress. */
|
|
3752
5032
|
202: {
|
|
3753
5033
|
headers: {
|
|
3754
5034
|
[name: string]: unknown;
|
|
3755
5035
|
};
|
|
3756
5036
|
content: {
|
|
3757
5037
|
'application/json': {
|
|
5038
|
+
/** @description The queued job's ID. Check its progress with `GET .../jobs/{jobId}`. */
|
|
3758
5039
|
jobId: string;
|
|
5040
|
+
/** @description Whether this request started a new refresh. `false` means a refresh was already running, and `jobId` is that refresh. */
|
|
3759
5041
|
started: boolean;
|
|
3760
5042
|
};
|
|
3761
5043
|
};
|
|
@@ -3765,48 +5047,84 @@ interface operations {
|
|
|
3765
5047
|
listSources: {
|
|
3766
5048
|
parameters: {
|
|
3767
5049
|
query?: {
|
|
5050
|
+
/** @description The `nextCursor` value from the previous page. Omit it to get the first page. */
|
|
3768
5051
|
cursor?: string;
|
|
5052
|
+
/** @description The maximum number of items to return. */
|
|
3769
5053
|
limit?: number;
|
|
5054
|
+
/** @description Return only sources with this status. */
|
|
3770
5055
|
status?: 'pending' | 'processing' | 'ready' | 'failed' | 'skipped';
|
|
5056
|
+
/** @description Return only the sources that this import produced. */
|
|
3771
5057
|
importId?: string;
|
|
5058
|
+
/** @description Comma-separated IDs of the sources to return, up to 200. Includes the parts of large sources that were split, which the default list leaves out. When set, `status` and `cursor` are ignored and every matching source is returned in one page. */
|
|
3772
5059
|
ids?: string;
|
|
3773
5060
|
};
|
|
3774
5061
|
header?: never;
|
|
3775
5062
|
path: {
|
|
5063
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
3776
5064
|
knowledgeBaseId: string;
|
|
3777
5065
|
};
|
|
3778
5066
|
cookie?: never;
|
|
3779
5067
|
};
|
|
3780
5068
|
requestBody?: never;
|
|
3781
5069
|
responses: {
|
|
3782
|
-
/** @description
|
|
5070
|
+
/** @description A page of sources. */
|
|
3783
5071
|
200: {
|
|
3784
5072
|
headers: {
|
|
3785
5073
|
[name: string]: unknown;
|
|
3786
5074
|
};
|
|
3787
5075
|
content: {
|
|
3788
5076
|
'application/json': {
|
|
5077
|
+
/** @description The items on this page. */
|
|
3789
5078
|
data: {
|
|
3790
|
-
/**
|
|
5079
|
+
/**
|
|
5080
|
+
* Format: uuid
|
|
5081
|
+
* @description The source's ID.
|
|
5082
|
+
*/
|
|
3791
5083
|
id: string;
|
|
3792
|
-
/**
|
|
5084
|
+
/**
|
|
5085
|
+
* Format: uuid
|
|
5086
|
+
* @description The `id` of the knowledge base that the source belongs to.
|
|
5087
|
+
*/
|
|
3793
5088
|
knowledgeBaseId: string;
|
|
5089
|
+
/** @description The source's name: the file name for an upload, the page title for a web page, or the document title for a dataset document. */
|
|
3794
5090
|
filename: string;
|
|
3795
|
-
/**
|
|
5091
|
+
/**
|
|
5092
|
+
* @description Where the source came from. `web`: a crawled web page. `file`: an uploaded file or inline text. `dataset`: a document from a Sanity dataset.
|
|
5093
|
+
* @enum {string}
|
|
5094
|
+
*/
|
|
3796
5095
|
kind: 'web' | 'file' | 'dataset';
|
|
5096
|
+
/** @description The source's size in bytes. */
|
|
3797
5097
|
sizeBytes: number;
|
|
3798
|
-
/**
|
|
5098
|
+
/**
|
|
5099
|
+
* @description The source's processing status. `pending`: waiting to be processed. `processing`: distilled and being summarized. `ready`: processed and available to builds. `failed`: couldn't be processed. `skipped`: not processed, because its file type isn't supported, it's too large, or it was split into smaller sources.
|
|
5100
|
+
* @enum {string}
|
|
5101
|
+
*/
|
|
3799
5102
|
status: 'pending' | 'processing' | 'ready' | 'failed' | 'skipped';
|
|
5103
|
+
/** @description A short summary of the source. `null` until the source is summarized. */
|
|
3800
5104
|
tldr: string | null;
|
|
5105
|
+
/** @description Topics the source covers. `null` until the source is summarized. */
|
|
3801
5106
|
topics: string[] | null;
|
|
5107
|
+
/** @description The page URL of a `web` source. `null` for other kinds. */
|
|
3802
5108
|
canonicalUrl: string | null;
|
|
3803
|
-
/**
|
|
5109
|
+
/** @description The `_id` of the Sanity document a `dataset` source came from. Use it to find the document in your studio. `null` for other kinds. */
|
|
5110
|
+
externalId: string | null;
|
|
5111
|
+
/**
|
|
5112
|
+
* Format: date-time
|
|
5113
|
+
* @description When the source's content was last fetched.
|
|
5114
|
+
*/
|
|
3804
5115
|
fetchedAt: string | null;
|
|
3805
|
-
/**
|
|
5116
|
+
/**
|
|
5117
|
+
* Format: date-time
|
|
5118
|
+
* @description When the source's content was last distilled into markdown. `null` until it's distilled.
|
|
5119
|
+
*/
|
|
3806
5120
|
distilledAt: string | null;
|
|
3807
|
-
/**
|
|
5121
|
+
/**
|
|
5122
|
+
* Format: date-time
|
|
5123
|
+
* @description When the source was added.
|
|
5124
|
+
*/
|
|
3808
5125
|
createdAt: string;
|
|
3809
5126
|
}[];
|
|
5127
|
+
/** @description The cursor for the next page. Pass it as `cursor` to get more results. `null` when there are no more pages. */
|
|
3810
5128
|
nextCursor: string | null;
|
|
3811
5129
|
};
|
|
3812
5130
|
};
|
|
@@ -3818,38 +5136,68 @@ interface operations {
|
|
|
3818
5136
|
query?: never;
|
|
3819
5137
|
header?: never;
|
|
3820
5138
|
path: {
|
|
5139
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
3821
5140
|
knowledgeBaseId: string;
|
|
5141
|
+
/** @description The source's ID. */
|
|
3822
5142
|
sourceId: string;
|
|
3823
5143
|
};
|
|
3824
5144
|
cookie?: never;
|
|
3825
5145
|
};
|
|
3826
5146
|
requestBody?: never;
|
|
3827
5147
|
responses: {
|
|
3828
|
-
/** @description
|
|
5148
|
+
/** @description A page, file, or document that an import produced and that builds cite. */
|
|
3829
5149
|
200: {
|
|
3830
5150
|
headers: {
|
|
3831
5151
|
[name: string]: unknown;
|
|
3832
5152
|
};
|
|
3833
5153
|
content: {
|
|
3834
5154
|
'application/json': {
|
|
3835
|
-
/**
|
|
5155
|
+
/**
|
|
5156
|
+
* Format: uuid
|
|
5157
|
+
* @description The source's ID.
|
|
5158
|
+
*/
|
|
3836
5159
|
id: string;
|
|
3837
|
-
/**
|
|
5160
|
+
/**
|
|
5161
|
+
* Format: uuid
|
|
5162
|
+
* @description The `id` of the knowledge base that the source belongs to.
|
|
5163
|
+
*/
|
|
3838
5164
|
knowledgeBaseId: string;
|
|
5165
|
+
/** @description The source's name: the file name for an upload, the page title for a web page, or the document title for a dataset document. */
|
|
3839
5166
|
filename: string;
|
|
3840
|
-
/**
|
|
5167
|
+
/**
|
|
5168
|
+
* @description Where the source came from. `web`: a crawled web page. `file`: an uploaded file or inline text. `dataset`: a document from a Sanity dataset.
|
|
5169
|
+
* @enum {string}
|
|
5170
|
+
*/
|
|
3841
5171
|
kind: 'web' | 'file' | 'dataset';
|
|
5172
|
+
/** @description The source's size in bytes. */
|
|
3842
5173
|
sizeBytes: number;
|
|
3843
|
-
/**
|
|
5174
|
+
/**
|
|
5175
|
+
* @description The source's processing status. `pending`: waiting to be processed. `processing`: distilled and being summarized. `ready`: processed and available to builds. `failed`: couldn't be processed. `skipped`: not processed, because its file type isn't supported, it's too large, or it was split into smaller sources.
|
|
5176
|
+
* @enum {string}
|
|
5177
|
+
*/
|
|
3844
5178
|
status: 'pending' | 'processing' | 'ready' | 'failed' | 'skipped';
|
|
5179
|
+
/** @description A short summary of the source. `null` until the source is summarized. */
|
|
3845
5180
|
tldr: string | null;
|
|
5181
|
+
/** @description Topics the source covers. `null` until the source is summarized. */
|
|
3846
5182
|
topics: string[] | null;
|
|
5183
|
+
/** @description The page URL of a `web` source. `null` for other kinds. */
|
|
3847
5184
|
canonicalUrl: string | null;
|
|
3848
|
-
/**
|
|
5185
|
+
/** @description The `_id` of the Sanity document a `dataset` source came from. Use it to find the document in your studio. `null` for other kinds. */
|
|
5186
|
+
externalId: string | null;
|
|
5187
|
+
/**
|
|
5188
|
+
* Format: date-time
|
|
5189
|
+
* @description When the source's content was last fetched.
|
|
5190
|
+
*/
|
|
3849
5191
|
fetchedAt: string | null;
|
|
3850
|
-
/**
|
|
5192
|
+
/**
|
|
5193
|
+
* Format: date-time
|
|
5194
|
+
* @description When the source's content was last distilled into markdown. `null` until it's distilled.
|
|
5195
|
+
*/
|
|
3851
5196
|
distilledAt: string | null;
|
|
3852
|
-
/**
|
|
5197
|
+
/**
|
|
5198
|
+
* Format: date-time
|
|
5199
|
+
* @description When the source was added.
|
|
5200
|
+
*/
|
|
3853
5201
|
createdAt: string;
|
|
3854
5202
|
};
|
|
3855
5203
|
};
|
|
@@ -3861,14 +5209,16 @@ interface operations {
|
|
|
3861
5209
|
query?: never;
|
|
3862
5210
|
header?: never;
|
|
3863
5211
|
path: {
|
|
5212
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
3864
5213
|
knowledgeBaseId: string;
|
|
5214
|
+
/** @description The source's ID. */
|
|
3865
5215
|
sourceId: string;
|
|
3866
5216
|
};
|
|
3867
5217
|
cookie?: never;
|
|
3868
5218
|
};
|
|
3869
5219
|
requestBody?: never;
|
|
3870
5220
|
responses: {
|
|
3871
|
-
/** @description
|
|
5221
|
+
/** @description The source was deleted. */
|
|
3872
5222
|
204: {
|
|
3873
5223
|
headers: {
|
|
3874
5224
|
[name: string]: unknown;
|
|
@@ -3882,33 +5232,45 @@ interface operations {
|
|
|
3882
5232
|
getSourceContent: {
|
|
3883
5233
|
parameters: {
|
|
3884
5234
|
query?: {
|
|
3885
|
-
/** @description
|
|
5235
|
+
/** @description Response format. `json` (default) returns the structured resource. `markdown` and `plain` return the content as rendered text, ready to pass to a model. */
|
|
3886
5236
|
format?: 'json' | 'markdown' | 'plain';
|
|
5237
|
+
/** @description The first line to return, starting at 1. Omit `startLine` and `endLine` to get the whole content. */
|
|
3887
5238
|
startLine?: number;
|
|
5239
|
+
/** @description The last line to return, inclusive. A value past the end returns everything up to the last line. */
|
|
3888
5240
|
endLine?: number;
|
|
3889
5241
|
};
|
|
3890
5242
|
header?: never;
|
|
3891
5243
|
path: {
|
|
5244
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
3892
5245
|
knowledgeBaseId: string;
|
|
5246
|
+
/** @description The source's ID. */
|
|
3893
5247
|
sourceId: string;
|
|
3894
5248
|
};
|
|
3895
5249
|
cookie?: never;
|
|
3896
5250
|
};
|
|
3897
5251
|
requestBody?: never;
|
|
3898
5252
|
responses: {
|
|
3899
|
-
/** @description
|
|
5253
|
+
/** @description A source's distilled markdown, or a range of its lines. */
|
|
3900
5254
|
200: {
|
|
3901
5255
|
headers: {
|
|
3902
5256
|
[name: string]: unknown;
|
|
3903
5257
|
};
|
|
3904
5258
|
content: {
|
|
3905
5259
|
'application/json': {
|
|
3906
|
-
/**
|
|
5260
|
+
/**
|
|
5261
|
+
* Format: uuid
|
|
5262
|
+
* @description The source's ID.
|
|
5263
|
+
*/
|
|
3907
5264
|
sourceId: string;
|
|
5265
|
+
/** @description The distilled markdown, or the requested lines of it. */
|
|
3908
5266
|
content: string;
|
|
5267
|
+
/** @description The number of lines in the full distilled content. */
|
|
3909
5268
|
totalLines: number;
|
|
5269
|
+
/** @description The range of lines returned, 1-indexed and inclusive. It can be shorter than requested when the range runs past the end. Both values are `0` when no lines are returned. */
|
|
3910
5270
|
slice: {
|
|
5271
|
+
/** @description The first line returned. */
|
|
3911
5272
|
start: number;
|
|
5273
|
+
/** @description The last line returned. */
|
|
3912
5274
|
end: number;
|
|
3913
5275
|
};
|
|
3914
5276
|
};
|
|
@@ -3923,106 +5285,184 @@ interface operations {
|
|
|
3923
5285
|
query?: never;
|
|
3924
5286
|
header?: never;
|
|
3925
5287
|
path: {
|
|
5288
|
+
/** @description Your ID for the conversation thread, unique within your organization. Up to 200 characters. */
|
|
3926
5289
|
threadId: string;
|
|
3927
5290
|
};
|
|
3928
5291
|
cookie?: never;
|
|
3929
5292
|
};
|
|
3930
|
-
/** @description
|
|
5293
|
+
/** @description A conversation transcript to save for one thread. */
|
|
3931
5294
|
requestBody: {
|
|
3932
5295
|
content: {
|
|
3933
5296
|
'application/json': {
|
|
5297
|
+
/** @description The full transcript so far, in order. It replaces the stored messages. */
|
|
3934
5298
|
messages: {
|
|
3935
|
-
/**
|
|
5299
|
+
/**
|
|
5300
|
+
* @description Who sent the message. `user` is the person talking to the agent, `assistant` is the agent, `system` is a system prompt, and `tool` is a tool call or tool result.
|
|
5301
|
+
* @enum {string}
|
|
5302
|
+
*/
|
|
3936
5303
|
role: 'user' | 'assistant' | 'system' | 'tool';
|
|
3937
|
-
/**
|
|
5304
|
+
/**
|
|
5305
|
+
* @description The message text. `null` when the message has no text, such as a tool call.
|
|
5306
|
+
* @default null
|
|
5307
|
+
*/
|
|
3938
5308
|
content?: string | null;
|
|
3939
|
-
/**
|
|
5309
|
+
/**
|
|
5310
|
+
* @description The name of the tool for a `tool` message. `null` on other messages.
|
|
5311
|
+
* @default null
|
|
5312
|
+
*/
|
|
3940
5313
|
toolName?: string | null;
|
|
3941
5314
|
/**
|
|
5315
|
+
* @description The kind of `tool` message. `call` is the agent calling the tool, and `result` is what the tool returned. `null` on other messages.
|
|
3942
5316
|
* @default null
|
|
3943
5317
|
* @enum {string|null}
|
|
3944
5318
|
*/
|
|
3945
5319
|
toolType?: 'call' | 'result' | null;
|
|
5320
|
+
/**
|
|
5321
|
+
* @description Why this step failed, including any stack trace. Set it on the tool result for a failed tool call, or on the assistant message for a turn that failed instead of answering. `null` when the step succeeded.
|
|
5322
|
+
* @default null
|
|
5323
|
+
*/
|
|
5324
|
+
error?: string | null;
|
|
3946
5325
|
}[];
|
|
5326
|
+
/** @description The provider of the model the agent used. When absent, the stored value stays unchanged. */
|
|
3947
5327
|
modelProvider?: string;
|
|
5328
|
+
/** @description The ID of the model the agent used. When absent, the stored value stays unchanged. */
|
|
3948
5329
|
modelId?: string;
|
|
3949
|
-
/** @description
|
|
5330
|
+
/** @description Token usage for one generation call. The API adds it to the conversation total, but only when this save changes the messages. */
|
|
3950
5331
|
tokenUsage?: {
|
|
5332
|
+
/** @description The number of input tokens. */
|
|
3951
5333
|
inputTokens?: number;
|
|
5334
|
+
/** @description The number of output tokens. */
|
|
3952
5335
|
outputTokens?: number;
|
|
5336
|
+
/** @description The total number of tokens. */
|
|
3953
5337
|
totalTokens?: number;
|
|
3954
5338
|
};
|
|
3955
|
-
/** @description
|
|
5339
|
+
/** @description Up to 20 tags that describe the conversation. Well-known keys are `mcpEndpoints` (names of the MCP endpoints the conversation used), `app`, and `environment`. Add any other keys you need. Replaces the stored metadata. When absent, the stored value stays unchanged. */
|
|
3956
5340
|
metadata?: {
|
|
3957
5341
|
[key: string]: string | string[];
|
|
3958
5342
|
};
|
|
3959
|
-
/** @description
|
|
5343
|
+
/** @description Your choice to share conversation telemetry with Sanity. Replaces the stored setting. When absent, the stored value stays unchanged. */
|
|
3960
5344
|
sharing?: {
|
|
5345
|
+
/** @description Whether to share classification metrics with Sanity: scores, sentiment, content gap counts, message counts and sizes, tool names, and model and token usage. Message content is not included. */
|
|
3961
5346
|
metrics?: boolean;
|
|
5347
|
+
/** @description Whether to share full conversation transcripts with Sanity. When `true`, the API also sets `metrics` to `true`. */
|
|
3962
5348
|
conversations?: boolean;
|
|
5349
|
+
/** @description How the Sanity team can reach you about your agent, such as an email address or a Discord handle. */
|
|
3963
5350
|
contact?: string;
|
|
3964
5351
|
};
|
|
3965
5352
|
};
|
|
3966
5353
|
};
|
|
3967
5354
|
};
|
|
3968
5355
|
responses: {
|
|
3969
|
-
/** @description
|
|
5356
|
+
/** @description A recorded agent conversation: its transcript, metadata, token usage, and classification. */
|
|
3970
5357
|
200: {
|
|
3971
5358
|
headers: {
|
|
3972
5359
|
[name: string]: unknown;
|
|
3973
5360
|
};
|
|
3974
5361
|
content: {
|
|
3975
5362
|
'application/json': {
|
|
5363
|
+
/** @description The conversation ID, unique within the organization. It matches the `_id` of the conversation document in your document store. */
|
|
3976
5364
|
id: string;
|
|
5365
|
+
/** @description Your identifier for the conversation thread, unique within the organization. Saving with the same `threadId` updates the same conversation. */
|
|
3977
5366
|
threadId: string;
|
|
3978
|
-
/** @description
|
|
5367
|
+
/** @description Tags that describe the conversation, such as `mcpEndpoints`, `app`, and `environment`. Filter on them in GROQ queries. `null` until a save includes `metadata`. */
|
|
3979
5368
|
metadata: {
|
|
3980
5369
|
[key: string]: string | string[];
|
|
3981
5370
|
} | null;
|
|
3982
|
-
/**
|
|
5371
|
+
/**
|
|
5372
|
+
* Format: date-time
|
|
5373
|
+
* @description When the API received the first save for this thread, as an ISO 8601 timestamp.
|
|
5374
|
+
*/
|
|
3983
5375
|
startedAt: string;
|
|
3984
|
-
/**
|
|
5376
|
+
/**
|
|
5377
|
+
* Format: date-time
|
|
5378
|
+
* @description When the conversation was last saved, as an ISO 8601 timestamp.
|
|
5379
|
+
*/
|
|
3985
5380
|
messagesUpdatedAt: string;
|
|
5381
|
+
/** @description The conversation transcript, in order. Each save replaces it. */
|
|
3986
5382
|
messages: {
|
|
3987
|
-
/**
|
|
5383
|
+
/**
|
|
5384
|
+
* @description Who sent the message. `user` is the person talking to the agent, `assistant` is the agent, `system` is a system prompt, and `tool` is a tool call or tool result.
|
|
5385
|
+
* @enum {string}
|
|
5386
|
+
*/
|
|
3988
5387
|
role: 'user' | 'assistant' | 'system' | 'tool';
|
|
3989
|
-
/**
|
|
5388
|
+
/**
|
|
5389
|
+
* @description The message text. `null` when the message has no text, such as a tool call.
|
|
5390
|
+
* @default null
|
|
5391
|
+
*/
|
|
3990
5392
|
content: string | null;
|
|
3991
|
-
/**
|
|
5393
|
+
/**
|
|
5394
|
+
* @description The name of the tool for a `tool` message. `null` on other messages.
|
|
5395
|
+
* @default null
|
|
5396
|
+
*/
|
|
3992
5397
|
toolName: string | null;
|
|
3993
5398
|
/**
|
|
5399
|
+
* @description The kind of `tool` message. `call` is the agent calling the tool, and `result` is what the tool returned. `null` on other messages.
|
|
3994
5400
|
* @default null
|
|
3995
5401
|
* @enum {string|null}
|
|
3996
5402
|
*/
|
|
3997
5403
|
toolType: 'call' | 'result' | null;
|
|
5404
|
+
/**
|
|
5405
|
+
* @description Why this step failed, including any stack trace. Set it on the tool result for a failed tool call, or on the assistant message for a turn that failed instead of answering. `null` when the step succeeded.
|
|
5406
|
+
* @default null
|
|
5407
|
+
*/
|
|
5408
|
+
error: string | null;
|
|
5409
|
+
/**
|
|
5410
|
+
* Format: date-time
|
|
5411
|
+
* @description When the API first received this message, as an ISO 8601 timestamp. The API sets it. Resending an unchanged message at the same position keeps its timestamp. `null` for messages recorded before timestamps existed.
|
|
5412
|
+
* @default null
|
|
5413
|
+
*/
|
|
5414
|
+
timestamp: string | null;
|
|
3998
5415
|
}[];
|
|
5416
|
+
/** @description The provider of the model the agent used. `null` until a save includes `modelProvider`. */
|
|
3999
5417
|
modelProvider: string | null;
|
|
5418
|
+
/** @description The ID of the model the agent used. `null` until a save includes `modelId`. */
|
|
4000
5419
|
modelId: string | null;
|
|
4001
|
-
/** @description
|
|
5420
|
+
/** @description The running total of token usage for the conversation. `null` until a save includes `tokenUsage`. */
|
|
4002
5421
|
tokenUsage: {
|
|
5422
|
+
/** @description The number of input tokens. */
|
|
4003
5423
|
inputTokens?: number;
|
|
5424
|
+
/** @description The number of output tokens. */
|
|
4004
5425
|
outputTokens?: number;
|
|
5426
|
+
/** @description The total number of tokens. */
|
|
4005
5427
|
totalTokens?: number;
|
|
4006
5428
|
} | null;
|
|
4007
|
-
/** @description
|
|
5429
|
+
/** @description The latest classification result. `null` until you record one. */
|
|
4008
5430
|
coreMetrics: {
|
|
5431
|
+
/** @description How well the agent resolved the user's needs, from 1 to 10. */
|
|
4009
5432
|
successScore?: number;
|
|
4010
|
-
/**
|
|
5433
|
+
/**
|
|
5434
|
+
* @description The overall sentiment of the conversation.
|
|
5435
|
+
* @enum {string}
|
|
5436
|
+
*/
|
|
4011
5437
|
sentiment?: 'positive' | 'neutral' | 'negative';
|
|
5438
|
+
/** @description Topics the agent couldn't answer because it lacked content. */
|
|
4012
5439
|
contentGaps?: string[];
|
|
4013
5440
|
} | null;
|
|
4014
|
-
/**
|
|
5441
|
+
/**
|
|
5442
|
+
* Format: date-time
|
|
5443
|
+
* @description When the latest classification result was recorded, as an ISO 8601 timestamp. The API sets it. `null` until you record a result.
|
|
5444
|
+
*/
|
|
4015
5445
|
classifiedAt: string | null;
|
|
5446
|
+
/** @description Why your classifier couldn't classify the conversation. `null` when no failure is recorded. Recording a result clears it. */
|
|
4016
5447
|
classificationError: string | null;
|
|
4017
|
-
/** @description
|
|
5448
|
+
/** @description Your choice to share conversation telemetry with Sanity. `null` until a save includes `sharing`. */
|
|
4018
5449
|
sharing: {
|
|
5450
|
+
/** @description Whether to share classification metrics with Sanity: scores, sentiment, content gap counts, message counts and sizes, tool names, and model and token usage. Message content is not included. */
|
|
4019
5451
|
metrics?: boolean;
|
|
5452
|
+
/** @description Whether to share full conversation transcripts with Sanity. When `true`, the API also sets `metrics` to `true`. */
|
|
4020
5453
|
conversations?: boolean;
|
|
5454
|
+
/** @description How the Sanity team can reach you about your agent, such as an email address or a Discord handle. */
|
|
4021
5455
|
contact?: string;
|
|
4022
5456
|
} | null;
|
|
4023
|
-
/**
|
|
5457
|
+
/**
|
|
5458
|
+
* Format: date-time
|
|
5459
|
+
* @description When the conversation was created, as an ISO 8601 timestamp.
|
|
5460
|
+
*/
|
|
4024
5461
|
createdAt: string;
|
|
4025
|
-
/**
|
|
5462
|
+
/**
|
|
5463
|
+
* Format: date-time
|
|
5464
|
+
* @description When the conversation was last changed, as an ISO 8601 timestamp.
|
|
5465
|
+
*/
|
|
4026
5466
|
updatedAt: string;
|
|
4027
5467
|
};
|
|
4028
5468
|
};
|
|
@@ -4034,82 +5474,143 @@ interface operations {
|
|
|
4034
5474
|
query?: never;
|
|
4035
5475
|
header?: never;
|
|
4036
5476
|
path: {
|
|
5477
|
+
/** @description Your ID for the conversation thread, unique within your organization. Up to 200 characters. */
|
|
4037
5478
|
threadId: string;
|
|
4038
5479
|
};
|
|
4039
5480
|
cookie?: never;
|
|
4040
5481
|
};
|
|
4041
|
-
/** @description
|
|
5482
|
+
/** @description A classification result or failure for one conversation. Send exactly one of `coreMetrics` or `classificationError`. */
|
|
4042
5483
|
requestBody: {
|
|
4043
5484
|
content: {
|
|
4044
5485
|
'application/json': {
|
|
5486
|
+
/** @description The classification result. The API sets `classifiedAt` and clears any recorded `classificationError`. */
|
|
4045
5487
|
coreMetrics?: {
|
|
5488
|
+
/** @description How well the agent resolved the user's needs, as an integer from 1 to 10. */
|
|
4046
5489
|
successScore: number;
|
|
4047
|
-
/**
|
|
5490
|
+
/**
|
|
5491
|
+
* @description The overall sentiment of the conversation.
|
|
5492
|
+
* @enum {string}
|
|
5493
|
+
*/
|
|
4048
5494
|
sentiment: 'positive' | 'neutral' | 'negative';
|
|
5495
|
+
/** @description Topics the agent couldn't answer because it lacked content. */
|
|
4049
5496
|
contentGaps: string[];
|
|
4050
5497
|
};
|
|
5498
|
+
/** @description Why your classifier couldn't classify the conversation. Any earlier classification result stays unchanged. */
|
|
4051
5499
|
classificationError?: string;
|
|
4052
5500
|
};
|
|
4053
5501
|
};
|
|
4054
5502
|
};
|
|
4055
5503
|
responses: {
|
|
4056
|
-
/** @description
|
|
5504
|
+
/** @description A recorded agent conversation: its transcript, metadata, token usage, and classification. */
|
|
4057
5505
|
200: {
|
|
4058
5506
|
headers: {
|
|
4059
5507
|
[name: string]: unknown;
|
|
4060
5508
|
};
|
|
4061
5509
|
content: {
|
|
4062
5510
|
'application/json': {
|
|
5511
|
+
/** @description The conversation ID, unique within the organization. It matches the `_id` of the conversation document in your document store. */
|
|
4063
5512
|
id: string;
|
|
5513
|
+
/** @description Your identifier for the conversation thread, unique within the organization. Saving with the same `threadId` updates the same conversation. */
|
|
4064
5514
|
threadId: string;
|
|
4065
|
-
/** @description
|
|
5515
|
+
/** @description Tags that describe the conversation, such as `mcpEndpoints`, `app`, and `environment`. Filter on them in GROQ queries. `null` until a save includes `metadata`. */
|
|
4066
5516
|
metadata: {
|
|
4067
5517
|
[key: string]: string | string[];
|
|
4068
5518
|
} | null;
|
|
4069
|
-
/**
|
|
5519
|
+
/**
|
|
5520
|
+
* Format: date-time
|
|
5521
|
+
* @description When the API received the first save for this thread, as an ISO 8601 timestamp.
|
|
5522
|
+
*/
|
|
4070
5523
|
startedAt: string;
|
|
4071
|
-
/**
|
|
5524
|
+
/**
|
|
5525
|
+
* Format: date-time
|
|
5526
|
+
* @description When the conversation was last saved, as an ISO 8601 timestamp.
|
|
5527
|
+
*/
|
|
4072
5528
|
messagesUpdatedAt: string;
|
|
5529
|
+
/** @description The conversation transcript, in order. Each save replaces it. */
|
|
4073
5530
|
messages: {
|
|
4074
|
-
/**
|
|
5531
|
+
/**
|
|
5532
|
+
* @description Who sent the message. `user` is the person talking to the agent, `assistant` is the agent, `system` is a system prompt, and `tool` is a tool call or tool result.
|
|
5533
|
+
* @enum {string}
|
|
5534
|
+
*/
|
|
4075
5535
|
role: 'user' | 'assistant' | 'system' | 'tool';
|
|
4076
|
-
/**
|
|
5536
|
+
/**
|
|
5537
|
+
* @description The message text. `null` when the message has no text, such as a tool call.
|
|
5538
|
+
* @default null
|
|
5539
|
+
*/
|
|
4077
5540
|
content: string | null;
|
|
4078
|
-
/**
|
|
5541
|
+
/**
|
|
5542
|
+
* @description The name of the tool for a `tool` message. `null` on other messages.
|
|
5543
|
+
* @default null
|
|
5544
|
+
*/
|
|
4079
5545
|
toolName: string | null;
|
|
4080
5546
|
/**
|
|
5547
|
+
* @description The kind of `tool` message. `call` is the agent calling the tool, and `result` is what the tool returned. `null` on other messages.
|
|
4081
5548
|
* @default null
|
|
4082
5549
|
* @enum {string|null}
|
|
4083
5550
|
*/
|
|
4084
5551
|
toolType: 'call' | 'result' | null;
|
|
5552
|
+
/**
|
|
5553
|
+
* @description Why this step failed, including any stack trace. Set it on the tool result for a failed tool call, or on the assistant message for a turn that failed instead of answering. `null` when the step succeeded.
|
|
5554
|
+
* @default null
|
|
5555
|
+
*/
|
|
5556
|
+
error: string | null;
|
|
5557
|
+
/**
|
|
5558
|
+
* Format: date-time
|
|
5559
|
+
* @description When the API first received this message, as an ISO 8601 timestamp. The API sets it. Resending an unchanged message at the same position keeps its timestamp. `null` for messages recorded before timestamps existed.
|
|
5560
|
+
* @default null
|
|
5561
|
+
*/
|
|
5562
|
+
timestamp: string | null;
|
|
4085
5563
|
}[];
|
|
5564
|
+
/** @description The provider of the model the agent used. `null` until a save includes `modelProvider`. */
|
|
4086
5565
|
modelProvider: string | null;
|
|
5566
|
+
/** @description The ID of the model the agent used. `null` until a save includes `modelId`. */
|
|
4087
5567
|
modelId: string | null;
|
|
4088
|
-
/** @description
|
|
5568
|
+
/** @description The running total of token usage for the conversation. `null` until a save includes `tokenUsage`. */
|
|
4089
5569
|
tokenUsage: {
|
|
5570
|
+
/** @description The number of input tokens. */
|
|
4090
5571
|
inputTokens?: number;
|
|
5572
|
+
/** @description The number of output tokens. */
|
|
4091
5573
|
outputTokens?: number;
|
|
5574
|
+
/** @description The total number of tokens. */
|
|
4092
5575
|
totalTokens?: number;
|
|
4093
5576
|
} | null;
|
|
4094
|
-
/** @description
|
|
5577
|
+
/** @description The latest classification result. `null` until you record one. */
|
|
4095
5578
|
coreMetrics: {
|
|
5579
|
+
/** @description How well the agent resolved the user's needs, from 1 to 10. */
|
|
4096
5580
|
successScore?: number;
|
|
4097
|
-
/**
|
|
5581
|
+
/**
|
|
5582
|
+
* @description The overall sentiment of the conversation.
|
|
5583
|
+
* @enum {string}
|
|
5584
|
+
*/
|
|
4098
5585
|
sentiment?: 'positive' | 'neutral' | 'negative';
|
|
5586
|
+
/** @description Topics the agent couldn't answer because it lacked content. */
|
|
4099
5587
|
contentGaps?: string[];
|
|
4100
5588
|
} | null;
|
|
4101
|
-
/**
|
|
5589
|
+
/**
|
|
5590
|
+
* Format: date-time
|
|
5591
|
+
* @description When the latest classification result was recorded, as an ISO 8601 timestamp. The API sets it. `null` until you record a result.
|
|
5592
|
+
*/
|
|
4102
5593
|
classifiedAt: string | null;
|
|
5594
|
+
/** @description Why your classifier couldn't classify the conversation. `null` when no failure is recorded. Recording a result clears it. */
|
|
4103
5595
|
classificationError: string | null;
|
|
4104
|
-
/** @description
|
|
5596
|
+
/** @description Your choice to share conversation telemetry with Sanity. `null` until a save includes `sharing`. */
|
|
4105
5597
|
sharing: {
|
|
5598
|
+
/** @description Whether to share classification metrics with Sanity: scores, sentiment, content gap counts, message counts and sizes, tool names, and model and token usage. Message content is not included. */
|
|
4106
5599
|
metrics?: boolean;
|
|
5600
|
+
/** @description Whether to share full conversation transcripts with Sanity. When `true`, the API also sets `metrics` to `true`. */
|
|
4107
5601
|
conversations?: boolean;
|
|
5602
|
+
/** @description How the Sanity team can reach you about your agent, such as an email address or a Discord handle. */
|
|
4108
5603
|
contact?: string;
|
|
4109
5604
|
} | null;
|
|
4110
|
-
/**
|
|
5605
|
+
/**
|
|
5606
|
+
* Format: date-time
|
|
5607
|
+
* @description When the conversation was created, as an ISO 8601 timestamp.
|
|
5608
|
+
*/
|
|
4111
5609
|
createdAt: string;
|
|
4112
|
-
/**
|
|
5610
|
+
/**
|
|
5611
|
+
* Format: date-time
|
|
5612
|
+
* @description When the conversation was last changed, as an ISO 8601 timestamp.
|
|
5613
|
+
*/
|
|
4113
5614
|
updatedAt: string;
|
|
4114
5615
|
};
|
|
4115
5616
|
};
|
|
@@ -4571,22 +6072,37 @@ declare class ContextClient {
|
|
|
4571
6072
|
id: string;
|
|
4572
6073
|
knowledgeBaseId: string;
|
|
4573
6074
|
content: {
|
|
4574
|
-
kind: 'conflict' | 'gap' | 'update_required' | 'add_entry' | 'remove_entry' | 'split_entry' | 'merge_entry';
|
|
4575
6075
|
severity: 'critical' | 'suggestion';
|
|
4576
6076
|
scopePath: string;
|
|
4577
6077
|
issue: string;
|
|
4578
6078
|
suggestedFix: string;
|
|
6079
|
+
kind: 'conflict';
|
|
6080
|
+
claimKey: string;
|
|
6081
|
+
sides: {
|
|
6082
|
+
claim: string;
|
|
6083
|
+
value?: string;
|
|
6084
|
+
entryPaths?: string[];
|
|
6085
|
+
sourceIds?: string[];
|
|
6086
|
+
span?: {
|
|
6087
|
+
sourceId: string;
|
|
6088
|
+
lineStart: number;
|
|
6089
|
+
lineEnd: number;
|
|
6090
|
+
};
|
|
6091
|
+
authority?: 'primary' | 'secondary' | 'community';
|
|
6092
|
+
}[];
|
|
6093
|
+
suggested?: number;
|
|
6094
|
+
} | {
|
|
6095
|
+
severity: 'critical' | 'suggestion';
|
|
6096
|
+
scopePath: string;
|
|
6097
|
+
issue: string;
|
|
6098
|
+
suggestedFix: string;
|
|
6099
|
+
kind: 'gap' | 'update_required' | 'add_entry' | 'remove_entry' | 'split_entry' | 'merge_entry';
|
|
4579
6100
|
citedSourceIds?: string[];
|
|
4580
6101
|
claimKey?: string;
|
|
4581
6102
|
involvedScopes?: string[];
|
|
4582
|
-
currentClaim?: string;
|
|
4583
|
-
alternativeClaim?: string;
|
|
4584
|
-
currentAuthority?: 'primary' | 'secondary' | 'community';
|
|
4585
|
-
alternativeAuthority?: 'primary' | 'secondary' | 'community';
|
|
4586
|
-
suggestedResolution?: 'keep_existing' | 'accept_new';
|
|
4587
6103
|
};
|
|
4588
6104
|
status: 'open' | 'accepted' | 'rejected';
|
|
4589
|
-
resolution:
|
|
6105
|
+
resolution: number | null;
|
|
4590
6106
|
resolvedBy: {
|
|
4591
6107
|
id: string;
|
|
4592
6108
|
kind: 'user' | 'robot';
|
|
@@ -4602,22 +6118,37 @@ declare class ContextClient {
|
|
|
4602
6118
|
id: string;
|
|
4603
6119
|
knowledgeBaseId: string;
|
|
4604
6120
|
content: {
|
|
4605
|
-
kind: 'conflict' | 'gap' | 'update_required' | 'add_entry' | 'remove_entry' | 'split_entry' | 'merge_entry';
|
|
4606
6121
|
severity: 'critical' | 'suggestion';
|
|
4607
6122
|
scopePath: string;
|
|
4608
6123
|
issue: string;
|
|
4609
6124
|
suggestedFix: string;
|
|
6125
|
+
kind: 'conflict';
|
|
6126
|
+
claimKey: string;
|
|
6127
|
+
sides: {
|
|
6128
|
+
claim: string;
|
|
6129
|
+
value?: string;
|
|
6130
|
+
entryPaths?: string[];
|
|
6131
|
+
sourceIds?: string[];
|
|
6132
|
+
span?: {
|
|
6133
|
+
sourceId: string;
|
|
6134
|
+
lineStart: number;
|
|
6135
|
+
lineEnd: number;
|
|
6136
|
+
};
|
|
6137
|
+
authority?: 'primary' | 'secondary' | 'community';
|
|
6138
|
+
}[];
|
|
6139
|
+
suggested?: number;
|
|
6140
|
+
} | {
|
|
6141
|
+
severity: 'critical' | 'suggestion';
|
|
6142
|
+
scopePath: string;
|
|
6143
|
+
issue: string;
|
|
6144
|
+
suggestedFix: string;
|
|
6145
|
+
kind: 'gap' | 'update_required' | 'add_entry' | 'remove_entry' | 'split_entry' | 'merge_entry';
|
|
4610
6146
|
citedSourceIds?: string[];
|
|
4611
6147
|
claimKey?: string;
|
|
4612
6148
|
involvedScopes?: string[];
|
|
4613
|
-
currentClaim?: string;
|
|
4614
|
-
alternativeClaim?: string;
|
|
4615
|
-
currentAuthority?: 'primary' | 'secondary' | 'community';
|
|
4616
|
-
alternativeAuthority?: 'primary' | 'secondary' | 'community';
|
|
4617
|
-
suggestedResolution?: 'keep_existing' | 'accept_new';
|
|
4618
6149
|
};
|
|
4619
6150
|
status: 'open' | 'accepted' | 'rejected';
|
|
4620
|
-
resolution:
|
|
6151
|
+
resolution: number | null;
|
|
4621
6152
|
resolvedBy: {
|
|
4622
6153
|
id: string;
|
|
4623
6154
|
kind: 'user' | 'robot';
|
|
@@ -4631,22 +6162,37 @@ declare class ContextClient {
|
|
|
4631
6162
|
id: string;
|
|
4632
6163
|
knowledgeBaseId: string;
|
|
4633
6164
|
content: {
|
|
4634
|
-
kind: 'conflict' | 'gap' | 'update_required' | 'add_entry' | 'remove_entry' | 'split_entry' | 'merge_entry';
|
|
4635
6165
|
severity: 'critical' | 'suggestion';
|
|
4636
6166
|
scopePath: string;
|
|
4637
6167
|
issue: string;
|
|
4638
6168
|
suggestedFix: string;
|
|
6169
|
+
kind: 'conflict';
|
|
6170
|
+
claimKey: string;
|
|
6171
|
+
sides: {
|
|
6172
|
+
claim: string;
|
|
6173
|
+
value?: string;
|
|
6174
|
+
entryPaths?: string[];
|
|
6175
|
+
sourceIds?: string[];
|
|
6176
|
+
span?: {
|
|
6177
|
+
sourceId: string;
|
|
6178
|
+
lineStart: number;
|
|
6179
|
+
lineEnd: number;
|
|
6180
|
+
};
|
|
6181
|
+
authority?: 'primary' | 'secondary' | 'community';
|
|
6182
|
+
}[];
|
|
6183
|
+
suggested?: number;
|
|
6184
|
+
} | {
|
|
6185
|
+
severity: 'critical' | 'suggestion';
|
|
6186
|
+
scopePath: string;
|
|
6187
|
+
issue: string;
|
|
6188
|
+
suggestedFix: string;
|
|
6189
|
+
kind: 'gap' | 'update_required' | 'add_entry' | 'remove_entry' | 'split_entry' | 'merge_entry';
|
|
4639
6190
|
citedSourceIds?: string[];
|
|
4640
6191
|
claimKey?: string;
|
|
4641
6192
|
involvedScopes?: string[];
|
|
4642
|
-
currentClaim?: string;
|
|
4643
|
-
alternativeClaim?: string;
|
|
4644
|
-
currentAuthority?: 'primary' | 'secondary' | 'community';
|
|
4645
|
-
alternativeAuthority?: 'primary' | 'secondary' | 'community';
|
|
4646
|
-
suggestedResolution?: 'keep_existing' | 'accept_new';
|
|
4647
6193
|
};
|
|
4648
6194
|
status: 'open' | 'accepted' | 'rejected';
|
|
4649
|
-
resolution:
|
|
6195
|
+
resolution: number | null;
|
|
4650
6196
|
resolvedBy: {
|
|
4651
6197
|
id: string;
|
|
4652
6198
|
kind: 'user' | 'robot';
|
|
@@ -4681,7 +6227,7 @@ declare class ContextClient {
|
|
|
4681
6227
|
origin: 'conflict' | 'human';
|
|
4682
6228
|
status: 'active' | 'archived';
|
|
4683
6229
|
statement: string;
|
|
4684
|
-
scopeSourceIds: string[]
|
|
6230
|
+
scopeSourceIds: string[];
|
|
4685
6231
|
archivedAt: string | null;
|
|
4686
6232
|
archivedReason: string | null;
|
|
4687
6233
|
sourceIssueId: string | null;
|
|
@@ -4784,6 +6330,7 @@ declare class ContextClient {
|
|
|
4784
6330
|
tldr: string | null;
|
|
4785
6331
|
topics: string[] | null;
|
|
4786
6332
|
canonicalUrl: string | null;
|
|
6333
|
+
externalId: string | null;
|
|
4787
6334
|
fetchedAt: string | null;
|
|
4788
6335
|
distilledAt: string | null;
|
|
4789
6336
|
createdAt: string;
|
|
@@ -4802,6 +6349,7 @@ declare class ContextClient {
|
|
|
4802
6349
|
tldr: string | null;
|
|
4803
6350
|
topics: string[] | null;
|
|
4804
6351
|
canonicalUrl: string | null;
|
|
6352
|
+
externalId: string | null;
|
|
4805
6353
|
fetchedAt: string | null;
|
|
4806
6354
|
distilledAt: string | null;
|
|
4807
6355
|
createdAt: string;
|
|
@@ -10340,5 +11888,5 @@ declare const createClient: (config: ClientConfig) => SanityClient;
|
|
|
10340
11888
|
* @deprecated Use the named export `createClient` instead of the `default` export
|
|
10341
11889
|
*/
|
|
10342
11890
|
declare const deprecatedCreateClient: (config: ClientConfig) => SanityClient;
|
|
10343
|
-
export { Action, ActionError, ActionErrorItem, type AgentActionParam, type AgentActionParams, type AgentActionPath, type AgentActionPathSegment, type AgentActionTarget, AllDocumentIdsMutationOptions, AllDocumentsMutationOptions, AnimatedImageFormat, AnimatedTransformOptions, Any, ApiError, ArchiveReleaseAction, AssetMetadataType, type AssetsClient, AttributeSet, AuthProvider, AuthProviderResponse, BaseActionOptions, BaseMutationOptions, BasePatch, BaseTransaction, ChannelError, ChannelErrorEvent, ClientConfig, ClientError, ClientPerspective, ClientReturn, ClientVariant, ClientVariantConditions, type CollaborationCommentCreate, type CollaborationCommentDocument, type CollaborationCommentFieldValue, type CollaborationCommentMessage, type CollaborationCommentPortableTextBlock, type CollaborationCommentRange, type CollaborationCommentReactionShortName, type CollaborationCommentSelection, type CollaborationCommentStatus, type CollaborationCommentTarget, type CollaborationCommentUpdate, type CollaborationCommentsClient, type CollaborationCommentsListenOptions, type CollaborationCommentsRequestOptions, type CollaborationCommentsWriteOptions, ConnectionFailedError, type ConstantAgentActionParam, ContentSourceMap, ContentSourceMapDocument, ContentSourceMapDocumentBase, ContentSourceMapDocumentValueSource, ContentSourceMapDocuments, ContentSourceMapLiteralSource, ContentSourceMapMapping, ContentSourceMapMappings, type ContentSourceMapParsedPath, type ContentSourceMapParsedPathKeyedSegment, ContentSourceMapPaths, ContentSourceMapRemoteDocument, ContentSourceMapSource, ContentSourceMapUnknownSource, ContentSourceMapValueMapping, types_d_exports as Context, CorsOriginError, CreateAction, CreateReleaseAction, CreateVariantAction, CreateVariantDefinitionAction, CreateVersionAction, CurrentSanityUser, DatasetAclMode, DatasetCreateOptions, DatasetEditOptions, DatasetResponse, type DatasetsClient, DatasetsResponse, DeleteAction, DeleteReleaseAction, DeleteVariantAction, DeleteVariantDefinitionAction, DiscardAction, DiscardVersionAction, DisconnectError, DisconnectEvent, type DocumentAgentActionParam, EXPERIMENTAL_API_WARNING, EditAction, EditReleaseAction, EditVariantAction, EditVariantDefinitionAction, EditableReleaseDocument, EmbeddingsSettings, EmbeddingsSettingsBody, ErrorProps, type EventSourceEvent, type EventSourceInstance, type FieldAgentActionParam, type FilterDefault, FilteredResponseQueryOptions, FirstDocumentIdMutationOptions, FirstDocumentMutationOptions, FitMode, type GenerateInstruction, type GenerateOperation, type GenerateTarget, type GenerateTargetDocument, type GenerateTargetInclude, type GroqAgentActionParam, type HttpError, HttpRequest, IdentifiedSanityDocumentStub, type ImageDescriptionOperation, ImportReleaseAction, InitializedClientConfig, type InitializedStegaConfig, InsertPatch, type InvokeFunctionEvent, type InvokeFunctionOptions, type InvokeFunctionRequest, ListenEvent, ListenEventName, ListenOptions, ListenParams, type LiveClient, LiveEvent, LiveEventGoAway, LiveEventMessage, LiveEventReconnect, LiveEventRestart, LiveEventWelcome, type Logger, MediaLibraryAssetDocument, MediaLibraryAssetInstanceIdentifier, MediaLibraryAssetVersion, MediaLibraryPlaybackInfoOptions, type MediaLibraryVideoClient, MediaLibraryVideoPlaybackTransformations, MessageError, MessageParseError, MultipleActionResult, MultipleMutationResult, Mutation, MutationError, MutationErrorItem, MutationEvent, MutationOperation, MutationSelection, MutationSelectionQueryParams, type ObservableAssetsClient, type ObservableCollaborationCommentsClient, type ObservableDatasetsClient, type ObservableMediaLibraryVideoClient, ObservablePatch, ObservablePatchBuilder, type ObservableProjectsClient, ObservableSanityClient, ObservableTransaction, type ObservableUsersClient, OpenEvent, PartialExcept, Patch, PatchBuilder, type PatchDocument, PatchMutationOperation, type PatchOperation, PatchOperations, PatchSelection, type PatchTarget, type ProjectsClient, type PromptRequest, PublishAction, PublishReleaseAction, PublishVariantAction, QueryOptions, QueryParams, QueryParseError, QueryWithoutParams, RawQueryResponse, RawQuerylessQueryResponse, RawRequestOptions, ReconnectEvent, ReleaseAction, ReleaseCardinality, ReleaseDocument, ReleaseId, ReleaseState, ReleaseType, ReplaceDraftAction, ReplaceVersionAction, RequestHandler, RequestHandlerOptions, RequestObservableOptions, RequestOptions, RequestUrlOptions, Requester, ResetEvent, type ResolveStudioUrl, ResponseQueryOptions, ResumableListenEventNames, ResumableListenOptions, SanityAssetDocument, SanityClient, SanityDocument, SanityDocumentStub, SanityImageAssetDocument, SanityImagePalette, SanityProject, SanityProjectMember, SanityProjectionsByResource, SanityQueries, SanityQueriesByResource, SanityReference, SanitySchemasByResource, SanityUser, ScheduleReleaseAction, ServerError, type ServerSentEvent, SingleActionResult, SingleMutationResult, StackablePerspective, type StegaConfig, type StegaConfigRequiredKeys, StillImageFormat, StoryboardTransformOptions, type StudioBaseRoute, type StudioBaseUrl, type StudioUrl, SyncTag, ThumbnailTransformOptions, type TimeoutErrorLike, Transaction, TransactionAllDocumentIdsMutationOptions, TransactionAllDocumentsMutationOptions, TransactionFirstDocumentIdMutationOptions, TransactionFirstDocumentMutationOptions, TransactionMutationOptions, type TransformDocument, type TransformOperation, type TransformTarget, type TransformTargetDocument, type TransformTargetInclude, type TranslateDocument, type TranslateTarget, type TranslateTargetInclude, UnarchiveReleaseAction, UnfilteredResponseQueryOptions, UnfilteredResponseWithoutQuery, UnpublishAction, UnpublishVariantAction, UnpublishVersionAction, UnscheduleReleaseAction, UploadBody, UploadClientConfig, UploadEvent, UploadProgressEvent, UploadResponseEvent, type UsersClient, VariantAction, VariantDefinitionAction, VersionAction, VideoPlaybackInfo, VideoPlaybackInfoItem, VideoPlaybackInfoItemPublic, VideoPlaybackInfoItemSigned, VideoPlaybackInfoPublic, VideoPlaybackInfoSigned, VideoPlaybackTokens, VideoRenditionInfo, VideoRenditionInfoPublic, VideoRenditionInfoSigned, VideoSubtitleInfo, VideoSubtitleInfoPublic, VideoSubtitleInfoSigned, WelcomeBackEvent, WelcomeEvent, type _listen, connectEventSource, createClient, deprecatedCreateClient as default, formatQueryParseError, isHttpError, isQueryParseError, isTimeoutError, requester, validateApiPerspective };
|
|
11891
|
+
export { Action, ActionError, ActionErrorItem, type AgentActionParam, type AgentActionParams, type AgentActionPath, type AgentActionPathSegment, type AgentActionTarget, AllDocumentIdsMutationOptions, AllDocumentsMutationOptions, AnimatedImageFormat, AnimatedTransformOptions, Any, ApiError, ArchiveReleaseAction, AssetMetadataType, type AssetsClient, AttributeSet, AuthProvider, AuthProviderResponse, BaseActionOptions, BaseMutationOptions, BasePatch, BaseTransaction, ChannelError, ChannelErrorEvent, ClientConfig, ClientError, ClientPerspective, ClientReturn, ClientVariant, ClientVariantConditions, type CollaborationCommentAnchor, type CollaborationCommentCreate, type CollaborationCommentDocument, type CollaborationCommentFieldValue, type CollaborationCommentMessage, type CollaborationCommentPortableTextBlock, type CollaborationCommentRange, type CollaborationCommentReactionShortName, type CollaborationCommentSelection, type CollaborationCommentStatus, type CollaborationCommentTarget, type CollaborationCommentUpdate, type CollaborationCommentsClient, type CollaborationCommentsListenOptions, type CollaborationCommentsRequestOptions, type CollaborationCommentsWriteOptions, ConnectionFailedError, type ConstantAgentActionParam, ContentSourceMap, ContentSourceMapDocument, ContentSourceMapDocumentBase, ContentSourceMapDocumentValueSource, ContentSourceMapDocuments, ContentSourceMapLiteralSource, ContentSourceMapMapping, ContentSourceMapMappings, type ContentSourceMapParsedPath, type ContentSourceMapParsedPathKeyedSegment, ContentSourceMapPaths, ContentSourceMapRemoteDocument, ContentSourceMapSource, ContentSourceMapUnknownSource, ContentSourceMapValueMapping, types_d_exports as Context, CorsOriginError, CreateAction, CreateReleaseAction, CreateVariantAction, CreateVariantDefinitionAction, CreateVersionAction, CurrentSanityUser, DatasetAclMode, DatasetCreateOptions, DatasetEditOptions, DatasetResponse, type DatasetsClient, DatasetsResponse, DeleteAction, DeleteReleaseAction, DeleteVariantAction, DeleteVariantDefinitionAction, DiscardAction, DiscardVersionAction, DisconnectError, DisconnectEvent, type DocumentAgentActionParam, EXPERIMENTAL_API_WARNING, EditAction, EditReleaseAction, EditVariantAction, EditVariantDefinitionAction, EditableReleaseDocument, EmbeddingsSettings, EmbeddingsSettingsBody, ErrorProps, type EventSourceEvent, type EventSourceInstance, type FieldAgentActionParam, type FilterDefault, FilteredResponseQueryOptions, FirstDocumentIdMutationOptions, FirstDocumentMutationOptions, FitMode, type GenerateInstruction, type GenerateOperation, type GenerateTarget, type GenerateTargetDocument, type GenerateTargetInclude, type GroqAgentActionParam, type HttpError, HttpRequest, IdentifiedSanityDocumentStub, type ImageDescriptionOperation, ImportReleaseAction, InitializedClientConfig, type InitializedStegaConfig, InsertPatch, type InvokeFunctionEvent, type InvokeFunctionOptions, type InvokeFunctionRequest, ListenEvent, ListenEventName, ListenOptions, ListenParams, type LiveClient, LiveEvent, LiveEventGoAway, LiveEventMessage, LiveEventReconnect, LiveEventRestart, LiveEventWelcome, type Logger, MediaLibraryAssetDocument, MediaLibraryAssetInstanceIdentifier, MediaLibraryAssetVersion, MediaLibraryPlaybackInfoOptions, type MediaLibraryVideoClient, MediaLibraryVideoPlaybackTransformations, MessageError, MessageParseError, MultipleActionResult, MultipleMutationResult, Mutation, MutationError, MutationErrorItem, MutationEvent, MutationOperation, MutationSelection, MutationSelectionQueryParams, type ObservableAssetsClient, type ObservableCollaborationCommentsClient, type ObservableDatasetsClient, type ObservableMediaLibraryVideoClient, ObservablePatch, ObservablePatchBuilder, type ObservableProjectsClient, ObservableSanityClient, ObservableTransaction, type ObservableUsersClient, OpenEvent, PartialExcept, Patch, PatchBuilder, type PatchDocument, PatchMutationOperation, type PatchOperation, PatchOperations, PatchSelection, type PatchTarget, type ProjectsClient, type PromptRequest, PublishAction, PublishReleaseAction, PublishVariantAction, QueryOptions, QueryParams, QueryParseError, QueryWithoutParams, RawQueryResponse, RawQuerylessQueryResponse, RawRequestOptions, ReconnectEvent, ReleaseAction, ReleaseCardinality, ReleaseDocument, ReleaseId, ReleaseState, ReleaseType, ReplaceDraftAction, ReplaceVersionAction, RequestHandler, RequestHandlerOptions, RequestObservableOptions, RequestOptions, RequestUrlOptions, Requester, ResetEvent, type ResolveStudioUrl, ResponseQueryOptions, ResumableListenEventNames, ResumableListenOptions, SanityAssetDocument, SanityClient, SanityDocument, SanityDocumentStub, SanityImageAssetDocument, SanityImagePalette, SanityProject, SanityProjectMember, SanityProjectionsByResource, SanityQueries, SanityQueriesByResource, SanityReference, SanitySchemasByResource, SanityUser, ScheduleReleaseAction, ServerError, type ServerSentEvent, SingleActionResult, SingleMutationResult, StackablePerspective, type StegaConfig, type StegaConfigRequiredKeys, StillImageFormat, StoryboardTransformOptions, type StudioBaseRoute, type StudioBaseUrl, type StudioUrl, SyncTag, ThumbnailTransformOptions, type TimeoutErrorLike, Transaction, TransactionAllDocumentIdsMutationOptions, TransactionAllDocumentsMutationOptions, TransactionFirstDocumentIdMutationOptions, TransactionFirstDocumentMutationOptions, TransactionMutationOptions, type TransformDocument, type TransformOperation, type TransformTarget, type TransformTargetDocument, type TransformTargetInclude, type TranslateDocument, type TranslateTarget, type TranslateTargetInclude, UnarchiveReleaseAction, UnfilteredResponseQueryOptions, UnfilteredResponseWithoutQuery, UnpublishAction, UnpublishVariantAction, UnpublishVersionAction, UnscheduleReleaseAction, UploadBody, UploadClientConfig, UploadEvent, UploadProgressEvent, UploadResponseEvent, type UsersClient, VariantAction, VariantDefinitionAction, VersionAction, VideoPlaybackInfo, VideoPlaybackInfoItem, VideoPlaybackInfoItemPublic, VideoPlaybackInfoItemSigned, VideoPlaybackInfoPublic, VideoPlaybackInfoSigned, VideoPlaybackTokens, VideoRenditionInfo, VideoRenditionInfoPublic, VideoRenditionInfoSigned, VideoSubtitleInfo, VideoSubtitleInfoPublic, VideoSubtitleInfoSigned, WelcomeBackEvent, WelcomeEvent, type _listen, connectEventSource, createClient, deprecatedCreateClient as default, formatQueryParseError, isHttpError, isQueryParseError, isTimeoutError, requester, validateApiPerspective };
|
|
10344
11892
|
//# sourceMappingURL=index.node.d.ts.map
|