@sanity/client 8.3.0 → 8.5.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 +80 -4
- package/dist/{browserUpload-2tz6Sdqp.js → browserUpload-C7PwCs-C.js} +6 -9
- package/dist/browserUpload-C7PwCs-C.js.map +1 -0
- package/dist/{browserUpload-CwpNx7Vl.js → browserUpload-D-2Rmfjo.js} +6 -9
- package/dist/browserUpload-D-2Rmfjo.js.map +1 -0
- package/dist/{config-3wiPP-sZ.js → config-CgJ16jET.js} +4 -2
- package/dist/config-CgJ16jET.js.map +1 -0
- package/dist/csm.js +1 -1
- package/dist/{dist-C9ExSk2R.js → dist-C5K_YcEU.js} +3 -2
- package/dist/{dist-C9ExSk2R.js.map → dist-C5K_YcEU.js.map} +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1111 -80
- package/dist/index.js.map +1 -1
- package/dist/index.node.d.ts +3561 -53
- package/dist/index.node.js +983 -30
- package/dist/index.node.js.map +1 -1
- package/dist/media-library.d.ts +1 -1
- package/dist/rolldown-runtime-4YWMqDIC.js +9 -0
- package/dist/stega.js +2 -2
- package/dist/{dist-Z8cIRxoB.js → stegaClean-YZRATV86.js} +19 -2
- package/dist/stegaClean-YZRATV86.js.map +1 -0
- package/dist/{stegaEncodeSourceMap-DbM2fTN4.js → stegaEncodeSourceMap-CO1HKnm2.js} +2 -2
- package/dist/{stegaEncodeSourceMap-DbM2fTN4.js.map → stegaEncodeSourceMap-CO1HKnm2.js.map} +1 -1
- package/dist/{stegaEncodeSourceMap-YR3NQ3iz.js → stegaEncodeSourceMap-Dj29aWKG.js} +2 -2
- package/dist/{stegaEncodeSourceMap-YR3NQ3iz.js.map → stegaEncodeSourceMap-Dj29aWKG.js.map} +1 -1
- package/dist/{types-0x2hPfhJ.d.ts → types-CtHEe8SF.d.ts} +3562 -54
- package/package.json +18 -15
- package/src/SanityClient.ts +183 -9
- package/src/agent/actions/AgentActionsClient.ts +8 -2
- package/src/assets/AssetsClient.ts +13 -2
- package/src/config.ts +1 -0
- package/src/context/ContextClient.ts +1006 -0
- package/src/context/openapi.json +5345 -0
- package/src/context/reads.ts +206 -0
- package/src/context/store.ts +100 -0
- package/src/context/types.gen.ts +2428 -0
- package/src/context/types.ts +228 -0
- package/src/data/dataMethods.ts +4 -1
- package/src/data/live.ts +1 -0
- package/src/datasets/DatasetsClient.ts +8 -2
- package/src/defineCreateClient.ts +1 -0
- package/src/http/browserUpload.ts +0 -12
- package/src/mediaLibrary/MediaLibraryVideoClient.ts +8 -2
- package/src/projects/ProjectsClient.ts +8 -2
- package/src/releases/ReleasesClient.ts +8 -2
- package/src/types.ts +68 -4
- package/src/users/UsersClient.ts +8 -2
- package/src/validators.ts +1 -0
- package/dist/browserUpload-2tz6Sdqp.js.map +0 -1
- package/dist/browserUpload-CwpNx7Vl.js.map +0 -1
- package/dist/config-3wiPP-sZ.js.map +0 -1
- package/dist/dist-Z8cIRxoB.js.map +0 -1
- package/dist/stegaClean-C18wLWau.js +0 -21
- package/dist/stegaClean-C18wLWau.js.map +0 -1
|
@@ -959,7 +959,10 @@ type TranslateDocumentSync<T extends Record<string, Any$1> = Record<string, Any$
|
|
|
959
959
|
type TranslateDocumentAsync = TranslateRequestBase & AgentActionAsync;
|
|
960
960
|
/** @beta */
|
|
961
961
|
type TranslateDocument<T extends Record<string, Any$1> = Record<string, Any$1>> = TranslateDocumentSync<T> | TranslateDocumentAsync;
|
|
962
|
-
/**
|
|
962
|
+
/**
|
|
963
|
+
* @public
|
|
964
|
+
* @inline
|
|
965
|
+
*/
|
|
963
966
|
declare class ObservableAgentsActionClient {
|
|
964
967
|
#private;
|
|
965
968
|
constructor(client: ObservableSanityClient$1, httpRequest: HttpRequest);
|
|
@@ -985,7 +988,10 @@ declare class ObservableAgentsActionClient {
|
|
|
985
988
|
_id: string;
|
|
986
989
|
} : IdentifiedSanityDocumentStub & DocumentShape>;
|
|
987
990
|
}
|
|
988
|
-
/**
|
|
991
|
+
/**
|
|
992
|
+
* @public
|
|
993
|
+
* @inline
|
|
994
|
+
*/
|
|
989
995
|
declare class AgentActionsClient {
|
|
990
996
|
#private;
|
|
991
997
|
constructor(client: SanityClient$1, httpRequest: HttpRequest);
|
|
@@ -1024,7 +1030,10 @@ declare class AgentActionsClient {
|
|
|
1024
1030
|
_id: string;
|
|
1025
1031
|
} : IdentifiedSanityDocumentStub & DocumentShape>;
|
|
1026
1032
|
}
|
|
1027
|
-
/**
|
|
1033
|
+
/**
|
|
1034
|
+
* @internal
|
|
1035
|
+
* @inline
|
|
1036
|
+
*/
|
|
1028
1037
|
declare class ObservableAssetsClient {
|
|
1029
1038
|
#private;
|
|
1030
1039
|
constructor(client: ObservableSanityClient$1, httpRequest: HttpRequest);
|
|
@@ -1059,7 +1068,10 @@ declare class ObservableAssetsClient {
|
|
|
1059
1068
|
document: SanityAssetDocument | SanityImageAssetDocument;
|
|
1060
1069
|
}>>;
|
|
1061
1070
|
}
|
|
1062
|
-
/**
|
|
1071
|
+
/**
|
|
1072
|
+
* @internal
|
|
1073
|
+
* @inline
|
|
1074
|
+
*/
|
|
1063
1075
|
declare class AssetsClient {
|
|
1064
1076
|
#private;
|
|
1065
1077
|
constructor(client: SanityClient$1, httpRequest: HttpRequest);
|
|
@@ -1600,50 +1612,3280 @@ declare class CollaborationCommentsClient {
|
|
|
1600
1612
|
* )
|
|
1601
1613
|
* ```
|
|
1602
1614
|
*
|
|
1603
|
-
* @param documentId - Document ID, in published, draft or version form
|
|
1604
|
-
* @returns Global document reference, of the form `resourceType:resourceId:documentId`
|
|
1615
|
+
* @param documentId - Document ID, in published, draft or version form
|
|
1616
|
+
* @returns Global document reference, of the form `resourceType:resourceId:documentId`
|
|
1617
|
+
*/
|
|
1618
|
+
getTargetDocumentRef(documentId: string): CollaborationCommentDocument['target']['document']['_ref'];
|
|
1619
|
+
/**
|
|
1620
|
+
* Fetch comments on the configured resource.
|
|
1621
|
+
*
|
|
1622
|
+
* Takes the same `query` and `params` as `client.fetch`, and switches from a
|
|
1623
|
+
* GET to a POST for queries too large for the request URL in the same way,
|
|
1624
|
+
* but queries the comments endpoint, which accepts none of the query options
|
|
1625
|
+
* `client.fetch` does (`perspective`, `useCdn`, `filterResponse`,
|
|
1626
|
+
* `resultSourceMap`, stega).
|
|
1627
|
+
*
|
|
1628
|
+
* The query runs against the organization store, which is not scoped to
|
|
1629
|
+
* comments, so filter on `_type == "sanity.comment"`.
|
|
1630
|
+
*
|
|
1631
|
+
* @param query - GROQ-query to perform
|
|
1632
|
+
* @param params - Optional query parameters
|
|
1633
|
+
* @param options - Optional request options
|
|
1634
|
+
*/
|
|
1635
|
+
fetch<R = unknown>(query: string, params?: QueryParams, options?: CollaborationCommentsRequestOptions): Promise<R>;
|
|
1636
|
+
/**
|
|
1637
|
+
* Listen for changes to comments on the configured resource.
|
|
1638
|
+
*
|
|
1639
|
+
* Mirrors `client.listen(query, params)`, and emits mutation events.
|
|
1640
|
+
*
|
|
1641
|
+
* @param query - GROQ-filter to listen to changes for
|
|
1642
|
+
* @param params - Optional query parameters
|
|
1643
|
+
*/
|
|
1644
|
+
listen(query: string, params?: QueryParams): Observable<MutationEvent<CollaborationCommentDocument>>;
|
|
1645
|
+
/**
|
|
1646
|
+
* Listen for changes to comments on the configured resource.
|
|
1647
|
+
*
|
|
1648
|
+
* Mirrors `client.listen(query, params, options)`.
|
|
1649
|
+
*
|
|
1650
|
+
* @param query - GROQ-filter to listen to changes for
|
|
1651
|
+
* @param params - Optional query parameters
|
|
1652
|
+
* @param options - The same listener options `client.listen` takes, forwarded
|
|
1653
|
+
* to the organization store's listener
|
|
1654
|
+
*/
|
|
1655
|
+
listen<Opts extends CollaborationCommentsListenOptions>(query: string, params: QueryParams | undefined, options: Opts): Observable<ListenEventFromOptions<CollaborationCommentDocument, Opts>>;
|
|
1656
|
+
}
|
|
1657
|
+
/**
|
|
1658
|
+
* This file was auto-generated by openapi-typescript.
|
|
1659
|
+
* Do not make direct changes to the file.
|
|
1660
|
+
*/
|
|
1661
|
+
interface paths {
|
|
1662
|
+
'/{apiVersion}/context/knowledge-bases': {
|
|
1663
|
+
parameters: {
|
|
1664
|
+
query?: never;
|
|
1665
|
+
header?: never;
|
|
1666
|
+
path?: never;
|
|
1667
|
+
cookie?: never;
|
|
1668
|
+
};
|
|
1669
|
+
/**
|
|
1670
|
+
* List knowledge bases
|
|
1671
|
+
* @description Returns the organization's knowledge bases visible to the caller, cursor-paginated.
|
|
1672
|
+
*/
|
|
1673
|
+
get: operations['listKnowledgeBases'];
|
|
1674
|
+
put?: never;
|
|
1675
|
+
/**
|
|
1676
|
+
* Create a knowledge base
|
|
1677
|
+
* @description Creates a knowledge base bound to a Sanity dataset, where its content documents will be stored.
|
|
1678
|
+
*/
|
|
1679
|
+
post: operations['createKnowledgeBase'];
|
|
1680
|
+
delete?: never;
|
|
1681
|
+
options?: never;
|
|
1682
|
+
head?: never;
|
|
1683
|
+
patch?: never;
|
|
1684
|
+
trace?: never;
|
|
1685
|
+
};
|
|
1686
|
+
'/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}': {
|
|
1687
|
+
parameters: {
|
|
1688
|
+
query?: never;
|
|
1689
|
+
header?: never;
|
|
1690
|
+
path?: never;
|
|
1691
|
+
cookie?: never;
|
|
1692
|
+
};
|
|
1693
|
+
/**
|
|
1694
|
+
* Get a knowledge base
|
|
1695
|
+
* @description Returns the knowledge base object: metadata and state. Resolves from the id alone, the public id (`kb...`) or the uuid; access is decided against the knowledge base's own organization, and an id the caller cannot read returns 404. For the built content, use the outline or entries endpoints.
|
|
1696
|
+
*/
|
|
1697
|
+
get: operations['getKnowledgeBase'];
|
|
1698
|
+
put?: never;
|
|
1699
|
+
post?: never;
|
|
1700
|
+
/**
|
|
1701
|
+
* Delete a knowledge base
|
|
1702
|
+
* @description Removes the knowledge base and everything it owns: sources, imports, and revisions. Content documents in the bound dataset are deleted best-effort, and stored source files are reclaimed by a separate cleanup.
|
|
1703
|
+
*/
|
|
1704
|
+
delete: operations['deleteKnowledgeBase'];
|
|
1705
|
+
options?: never;
|
|
1706
|
+
head?: never;
|
|
1707
|
+
/**
|
|
1708
|
+
* Update a knowledge base
|
|
1709
|
+
* @description Edits the name and description, or the recurring refresh controls (`refreshEnabled`, `refreshFrequency`). Refresh fields return 422 for knowledge bases with no web or dataset source. Disabling pauses the schedule; manual refresh still works.
|
|
1710
|
+
*/
|
|
1711
|
+
patch: operations['updateKnowledgeBase'];
|
|
1712
|
+
trace?: never;
|
|
1713
|
+
};
|
|
1714
|
+
'/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/build': {
|
|
1715
|
+
parameters: {
|
|
1716
|
+
query?: never;
|
|
1717
|
+
header?: never;
|
|
1718
|
+
path?: never;
|
|
1719
|
+
cookie?: never;
|
|
1720
|
+
};
|
|
1721
|
+
get?: never;
|
|
1722
|
+
put?: never;
|
|
1723
|
+
/**
|
|
1724
|
+
* Trigger a knowledge base build
|
|
1725
|
+
* @description Queues a build over the current corpus and returns a job id right away. If a build is already running, you get that job instead of a second one.
|
|
1726
|
+
*/
|
|
1727
|
+
post: operations['buildKnowledgeBase'];
|
|
1728
|
+
delete?: never;
|
|
1729
|
+
options?: never;
|
|
1730
|
+
head?: never;
|
|
1731
|
+
patch?: never;
|
|
1732
|
+
trace?: never;
|
|
1733
|
+
};
|
|
1734
|
+
'/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/build/cancel': {
|
|
1735
|
+
parameters: {
|
|
1736
|
+
query?: never;
|
|
1737
|
+
header?: never;
|
|
1738
|
+
path?: never;
|
|
1739
|
+
cookie?: never;
|
|
1740
|
+
};
|
|
1741
|
+
get?: never;
|
|
1742
|
+
put?: never;
|
|
1743
|
+
/**
|
|
1744
|
+
* Cancel an in-progress build
|
|
1745
|
+
* @description Cancels the running build and resets the knowledge base so it can be rebuilt.
|
|
1746
|
+
*/
|
|
1747
|
+
post: operations['cancelKnowledgeBaseBuild'];
|
|
1748
|
+
delete?: never;
|
|
1749
|
+
options?: never;
|
|
1750
|
+
head?: never;
|
|
1751
|
+
patch?: never;
|
|
1752
|
+
trace?: never;
|
|
1753
|
+
};
|
|
1754
|
+
'/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/entries/{entryPath}/rebuild': {
|
|
1755
|
+
parameters: {
|
|
1756
|
+
query?: never;
|
|
1757
|
+
header?: never;
|
|
1758
|
+
path?: never;
|
|
1759
|
+
cookie?: never;
|
|
1760
|
+
};
|
|
1761
|
+
get?: never;
|
|
1762
|
+
put?: never;
|
|
1763
|
+
/**
|
|
1764
|
+
* Rebuild an entry from its sources
|
|
1765
|
+
* @description Queues a re-write of the entry at this path from its cited sources and the active instructions, and returns a job id right away. The response also names the other entries citing any of the same sources: a source-tied rule affects every page citing that source, so those may change too.
|
|
1766
|
+
*/
|
|
1767
|
+
post: operations['rebuildEntry'];
|
|
1768
|
+
delete?: never;
|
|
1769
|
+
options?: never;
|
|
1770
|
+
head?: never;
|
|
1771
|
+
patch?: never;
|
|
1772
|
+
trace?: never;
|
|
1773
|
+
};
|
|
1774
|
+
'/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/imports': {
|
|
1775
|
+
parameters: {
|
|
1776
|
+
query?: never;
|
|
1777
|
+
header?: never;
|
|
1778
|
+
path?: never;
|
|
1779
|
+
cookie?: never;
|
|
1780
|
+
};
|
|
1781
|
+
/**
|
|
1782
|
+
* List imports
|
|
1783
|
+
* @description Everything added to this knowledge base, one row per import: a file upload, web crawl, dataset bind, or inline text. Cursor-paginated. The sources each import produced live under `/sources`.
|
|
1784
|
+
*/
|
|
1785
|
+
get: operations['listImports'];
|
|
1786
|
+
put?: never;
|
|
1787
|
+
/**
|
|
1788
|
+
* Create an import (text, crawl, or dataset)
|
|
1789
|
+
* @description Adds content, discriminated on `type`: `text` for inline content, `crawl` for a website, `dataset` for a GROQ-filtered Sanity dataset. Each variant queues processing and returns a job id to poll. For files, use `POST .../imports/uploads` instead. Re-adding an existing crawl url returns 409 `webSourceRootConflict`; exceeding the crawl root limit returns 409 `webSourceRootLimitExceeded`. Supports the `Idempotency-Key` header.
|
|
1790
|
+
*/
|
|
1791
|
+
post: operations['createImport'];
|
|
1792
|
+
delete?: never;
|
|
1793
|
+
options?: never;
|
|
1794
|
+
head?: never;
|
|
1795
|
+
patch?: never;
|
|
1796
|
+
trace?: never;
|
|
1797
|
+
};
|
|
1798
|
+
'/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/imports/uploads': {
|
|
1799
|
+
parameters: {
|
|
1800
|
+
query?: never;
|
|
1801
|
+
header?: never;
|
|
1802
|
+
path?: never;
|
|
1803
|
+
cookie?: never;
|
|
1804
|
+
};
|
|
1805
|
+
get?: never;
|
|
1806
|
+
put?: never;
|
|
1807
|
+
/**
|
|
1808
|
+
* Start a file-upload import
|
|
1809
|
+
* @description Creates a file-upload import and returns a single-use signed upload URL. PUT the file bytes to it, then call `POST .../imports/uploads/{importId}/complete` to start ingestion. The bytes never pass through this API. Supports the `Idempotency-Key` header.
|
|
1810
|
+
*/
|
|
1811
|
+
post: operations['startUpload'];
|
|
1812
|
+
delete?: never;
|
|
1813
|
+
options?: never;
|
|
1814
|
+
head?: never;
|
|
1815
|
+
patch?: never;
|
|
1816
|
+
trace?: never;
|
|
1817
|
+
};
|
|
1818
|
+
'/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/imports/uploads/{importId}/complete': {
|
|
1819
|
+
parameters: {
|
|
1820
|
+
query?: never;
|
|
1821
|
+
header?: never;
|
|
1822
|
+
path?: never;
|
|
1823
|
+
cookie?: never;
|
|
1824
|
+
};
|
|
1825
|
+
get?: never;
|
|
1826
|
+
put?: never;
|
|
1827
|
+
/**
|
|
1828
|
+
* Complete a file-upload import
|
|
1829
|
+
* @description Call after the file bytes are uploaded to the signed URL. Starts processing and returns a job id to poll.
|
|
1830
|
+
*/
|
|
1831
|
+
post: operations['completeUpload'];
|
|
1832
|
+
delete?: never;
|
|
1833
|
+
options?: never;
|
|
1834
|
+
head?: never;
|
|
1835
|
+
patch?: never;
|
|
1836
|
+
trace?: never;
|
|
1837
|
+
};
|
|
1838
|
+
'/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/imports/{importId}': {
|
|
1839
|
+
parameters: {
|
|
1840
|
+
query?: never;
|
|
1841
|
+
header?: never;
|
|
1842
|
+
path?: never;
|
|
1843
|
+
cookie?: never;
|
|
1844
|
+
};
|
|
1845
|
+
/**
|
|
1846
|
+
* Get a single import
|
|
1847
|
+
* @description Returns one import with its kind and processing status.
|
|
1848
|
+
*/
|
|
1849
|
+
get: operations['getImport'];
|
|
1850
|
+
put?: never;
|
|
1851
|
+
post?: never;
|
|
1852
|
+
/**
|
|
1853
|
+
* Delete an import
|
|
1854
|
+
* @description Removes the import and every source it produced, and cancels its ingest if one is still running. Use it to discard something added by mistake.
|
|
1855
|
+
*/
|
|
1856
|
+
delete: operations['deleteImport'];
|
|
1857
|
+
options?: never;
|
|
1858
|
+
head?: never;
|
|
1859
|
+
patch?: never;
|
|
1860
|
+
trace?: never;
|
|
1861
|
+
};
|
|
1862
|
+
'/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/imports/{importId}/download': {
|
|
1863
|
+
parameters: {
|
|
1864
|
+
query?: never;
|
|
1865
|
+
header?: never;
|
|
1866
|
+
path?: never;
|
|
1867
|
+
cookie?: never;
|
|
1868
|
+
};
|
|
1869
|
+
/**
|
|
1870
|
+
* Get a download URL for an import
|
|
1871
|
+
* @description Mints a short-lived signed URL serving the import's original bytes as an attachment. Use it before `expiresAt`; the bytes never pass through this API. Only file and text imports carry original bytes; crawls and dataset binds return 409 `importInvalidState`.
|
|
1872
|
+
*/
|
|
1873
|
+
get: operations['downloadImport'];
|
|
1874
|
+
put?: never;
|
|
1875
|
+
post?: never;
|
|
1876
|
+
delete?: never;
|
|
1877
|
+
options?: never;
|
|
1878
|
+
head?: never;
|
|
1879
|
+
patch?: never;
|
|
1880
|
+
trace?: never;
|
|
1881
|
+
};
|
|
1882
|
+
'/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/instructions': {
|
|
1883
|
+
parameters: {
|
|
1884
|
+
query?: never;
|
|
1885
|
+
header?: never;
|
|
1886
|
+
path?: never;
|
|
1887
|
+
cookie?: never;
|
|
1888
|
+
};
|
|
1889
|
+
get?: never;
|
|
1890
|
+
put?: never;
|
|
1891
|
+
/**
|
|
1892
|
+
* Author a human instruction
|
|
1893
|
+
* @description Creates a standing rule that every future build honors. Tie it to one or more sources with `scopeSourceIds`, or leave it null to apply knowledge-base-wide. Pass `rebuildPaths` to immediately rebuild those entries under the new rule; the response carries the rebuild job id, or null when the rebuild could not start (the rule is saved either way). Pass `verified` after a completed synchronous contradiction check to skip the background one; if the requested rebuild fails to start, the background check runs anyway so the contradicting pages get filed as issues.
|
|
1894
|
+
*/
|
|
1895
|
+
post: operations['createInstruction'];
|
|
1896
|
+
delete?: never;
|
|
1897
|
+
options?: never;
|
|
1898
|
+
head?: never;
|
|
1899
|
+
patch?: never;
|
|
1900
|
+
trace?: never;
|
|
1901
|
+
};
|
|
1902
|
+
'/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/instructions/{instructionId}': {
|
|
1903
|
+
parameters: {
|
|
1904
|
+
query?: never;
|
|
1905
|
+
header?: never;
|
|
1906
|
+
path?: never;
|
|
1907
|
+
cookie?: never;
|
|
1908
|
+
};
|
|
1909
|
+
get?: never;
|
|
1910
|
+
put?: never;
|
|
1911
|
+
post?: never;
|
|
1912
|
+
/**
|
|
1913
|
+
* Delete an instruction
|
|
1914
|
+
* @description Deletes the rule. Builds stop honoring it from the next run.
|
|
1915
|
+
*/
|
|
1916
|
+
delete: operations['deleteInstruction'];
|
|
1917
|
+
options?: never;
|
|
1918
|
+
head?: never;
|
|
1919
|
+
/**
|
|
1920
|
+
* Edit an instruction
|
|
1921
|
+
* @description Edits the statement or scope. The change applies from the next build. Any edit re-affirms the rule: an archived rule returns to active, re-anchored to the sources' current content.
|
|
1922
|
+
*/
|
|
1923
|
+
patch: operations['updateInstruction'];
|
|
1924
|
+
trace?: never;
|
|
1925
|
+
};
|
|
1926
|
+
'/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/issues/apply': {
|
|
1927
|
+
parameters: {
|
|
1928
|
+
query?: never;
|
|
1929
|
+
header?: never;
|
|
1930
|
+
path?: never;
|
|
1931
|
+
cookie?: never;
|
|
1932
|
+
};
|
|
1933
|
+
get?: never;
|
|
1934
|
+
put?: never;
|
|
1935
|
+
/**
|
|
1936
|
+
* Apply accepted issues to a Context
|
|
1937
|
+
* @description Queues a job that applies accepted issues, rewrites the affected entries, and commits a new revision. Returns a job id. Issue ids that no longer exist are skipped.
|
|
1938
|
+
*/
|
|
1939
|
+
post: operations['applyIssues'];
|
|
1940
|
+
delete?: never;
|
|
1941
|
+
options?: never;
|
|
1942
|
+
head?: never;
|
|
1943
|
+
patch?: never;
|
|
1944
|
+
trace?: never;
|
|
1945
|
+
};
|
|
1946
|
+
'/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/issues/{issueId}/dismiss': {
|
|
1947
|
+
parameters: {
|
|
1948
|
+
query?: never;
|
|
1949
|
+
header?: never;
|
|
1950
|
+
path?: never;
|
|
1951
|
+
cookie?: never;
|
|
1952
|
+
};
|
|
1953
|
+
get?: never;
|
|
1954
|
+
put?: never;
|
|
1955
|
+
/**
|
|
1956
|
+
* Dismiss an issue
|
|
1957
|
+
* @description Marks the issue rejected. Idempotent: dismissing an issue that already left the queue returns it as-is. 422 `issueDocumentInvalid` when the document was hand-edited into an unverifiable shape; 409 `issueTransitionConflict` on a concurrent edit, safe to retry.
|
|
1958
|
+
*/
|
|
1959
|
+
post: operations['dismissIssue'];
|
|
1960
|
+
delete?: never;
|
|
1961
|
+
options?: never;
|
|
1962
|
+
head?: never;
|
|
1963
|
+
patch?: never;
|
|
1964
|
+
trace?: never;
|
|
1965
|
+
};
|
|
1966
|
+
'/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/issues/{issueId}/reopen': {
|
|
1967
|
+
parameters: {
|
|
1968
|
+
query?: never;
|
|
1969
|
+
header?: never;
|
|
1970
|
+
path?: never;
|
|
1971
|
+
cookie?: never;
|
|
1972
|
+
};
|
|
1973
|
+
get?: never;
|
|
1974
|
+
put?: never;
|
|
1975
|
+
/**
|
|
1976
|
+
* Reopen an accepted conflict
|
|
1977
|
+
* @description Returns an accepted conflict to triage, clearing its resolution and deleting the instruction it minted. Idempotent for issues that are not accepted conflicts.
|
|
1978
|
+
*/
|
|
1979
|
+
post: operations['reopenIssue'];
|
|
1980
|
+
delete?: never;
|
|
1981
|
+
options?: never;
|
|
1982
|
+
head?: never;
|
|
1983
|
+
patch?: never;
|
|
1984
|
+
trace?: never;
|
|
1985
|
+
};
|
|
1986
|
+
'/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/issues/{issueId}/resolve': {
|
|
1987
|
+
parameters: {
|
|
1988
|
+
query?: never;
|
|
1989
|
+
header?: never;
|
|
1990
|
+
path?: never;
|
|
1991
|
+
cookie?: never;
|
|
1992
|
+
};
|
|
1993
|
+
get?: never;
|
|
1994
|
+
put?: never;
|
|
1995
|
+
/**
|
|
1996
|
+
* Resolve a conflict issue
|
|
1997
|
+
* @description Settles a conflict with one of two choices: `keep_existing` or `accept_new` (rewrites the entry; the returned `jobId` tracks it). Only conflict issues are resolvable, and a dismissed issue must be reopened first. The decision becomes a standing instruction for every future build; `resolvedBy` records who decided.
|
|
1998
|
+
*/
|
|
1999
|
+
post: operations['resolveIssue'];
|
|
2000
|
+
delete?: never;
|
|
2001
|
+
options?: never;
|
|
2002
|
+
head?: never;
|
|
2003
|
+
patch?: never;
|
|
2004
|
+
trace?: never;
|
|
2005
|
+
};
|
|
2006
|
+
'/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/jobs/{jobId}': {
|
|
2007
|
+
parameters: {
|
|
2008
|
+
query?: never;
|
|
2009
|
+
header?: never;
|
|
2010
|
+
path?: never;
|
|
2011
|
+
cookie?: never;
|
|
2012
|
+
};
|
|
2013
|
+
/**
|
|
2014
|
+
* Get a job by id
|
|
2015
|
+
* @description Returns the status of a job, such as a build or an import. Job ids come from the endpoint that queued the work.
|
|
2016
|
+
*/
|
|
2017
|
+
get: operations['getJob'];
|
|
2018
|
+
put?: never;
|
|
2019
|
+
post?: never;
|
|
2020
|
+
delete?: never;
|
|
2021
|
+
options?: never;
|
|
2022
|
+
head?: never;
|
|
2023
|
+
patch?: never;
|
|
2024
|
+
trace?: never;
|
|
2025
|
+
};
|
|
2026
|
+
'/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/refresh': {
|
|
2027
|
+
parameters: {
|
|
2028
|
+
query?: never;
|
|
2029
|
+
header?: never;
|
|
2030
|
+
path?: never;
|
|
2031
|
+
cookie?: never;
|
|
2032
|
+
};
|
|
2033
|
+
get?: never;
|
|
2034
|
+
put?: never;
|
|
2035
|
+
/**
|
|
2036
|
+
* Trigger an incremental refresh
|
|
2037
|
+
* @description Queues a refresh: recrawls each web source, diffs the corpus against the last build, and files change issues. Returns a job id, with `started: false` when a refresh was already in flight. Supports the `Idempotency-Key` header.
|
|
2038
|
+
*/
|
|
2039
|
+
post: operations['refreshKnowledgeBase'];
|
|
2040
|
+
delete?: never;
|
|
2041
|
+
options?: never;
|
|
2042
|
+
head?: never;
|
|
2043
|
+
patch?: never;
|
|
2044
|
+
trace?: never;
|
|
2045
|
+
};
|
|
2046
|
+
'/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/sources': {
|
|
2047
|
+
parameters: {
|
|
2048
|
+
query?: never;
|
|
2049
|
+
header?: never;
|
|
2050
|
+
path?: never;
|
|
2051
|
+
cookie?: never;
|
|
2052
|
+
};
|
|
2053
|
+
/**
|
|
2054
|
+
* List sources
|
|
2055
|
+
* @description The distilled units builds cite: the pages, files, and documents your imports expanded into. Read-only; add content via `/imports`. Cursor-paginated, filter by `status`.
|
|
2056
|
+
*/
|
|
2057
|
+
get: operations['listSources'];
|
|
2058
|
+
put?: never;
|
|
2059
|
+
post?: never;
|
|
2060
|
+
delete?: never;
|
|
2061
|
+
options?: never;
|
|
2062
|
+
head?: never;
|
|
2063
|
+
patch?: never;
|
|
2064
|
+
trace?: never;
|
|
2065
|
+
};
|
|
2066
|
+
'/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/sources/{sourceId}': {
|
|
2067
|
+
parameters: {
|
|
2068
|
+
query?: never;
|
|
2069
|
+
header?: never;
|
|
2070
|
+
path?: never;
|
|
2071
|
+
cookie?: never;
|
|
2072
|
+
};
|
|
2073
|
+
/**
|
|
2074
|
+
* Get a single source
|
|
2075
|
+
* @description Returns one source with its metadata and processing status.
|
|
2076
|
+
*/
|
|
2077
|
+
get: operations['getSource'];
|
|
2078
|
+
put?: never;
|
|
2079
|
+
post?: never;
|
|
2080
|
+
/**
|
|
2081
|
+
* Delete a source
|
|
2082
|
+
* @description Removes the source immediately. Entries are not modified here — citations to it are cleaned up by the next build or check for changes, where entries left without sources become removal proposals. Human-edited entries are never modified.
|
|
2083
|
+
*/
|
|
2084
|
+
delete: operations['deleteSource'];
|
|
2085
|
+
options?: never;
|
|
2086
|
+
head?: never;
|
|
2087
|
+
patch?: never;
|
|
2088
|
+
trace?: never;
|
|
2089
|
+
};
|
|
2090
|
+
'/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/sources/{sourceId}/content': {
|
|
2091
|
+
parameters: {
|
|
2092
|
+
query?: never;
|
|
2093
|
+
header?: never;
|
|
2094
|
+
path?: never;
|
|
2095
|
+
cookie?: never;
|
|
2096
|
+
};
|
|
2097
|
+
/**
|
|
2098
|
+
* Read a source's distilled content
|
|
2099
|
+
* @description The distilled markdown builds cite, the same text the pipeline itself reads. Use it to verify an issue's claims against the sources its `citedSourceIds` name. Optional `startLine` and `endLine` (1-indexed, inclusive) fetch just a span. JSON by default; `?format=markdown` returns the raw text. 409 `sourceNotDistilled` until distillation has produced content.
|
|
2100
|
+
*/
|
|
2101
|
+
get: operations['getSourceContent'];
|
|
2102
|
+
put?: never;
|
|
2103
|
+
post?: never;
|
|
2104
|
+
delete?: never;
|
|
2105
|
+
options?: never;
|
|
2106
|
+
head?: never;
|
|
2107
|
+
patch?: never;
|
|
2108
|
+
trace?: never;
|
|
2109
|
+
};
|
|
2110
|
+
'/{apiVersion}/context/organizations/{organizationId}/conversations/{threadId}': {
|
|
2111
|
+
parameters: {
|
|
2112
|
+
query?: never;
|
|
2113
|
+
header?: never;
|
|
2114
|
+
path?: never;
|
|
2115
|
+
cookie?: never;
|
|
2116
|
+
};
|
|
2117
|
+
get?: never;
|
|
2118
|
+
/**
|
|
2119
|
+
* Record a conversation
|
|
2120
|
+
* @description Upserts the conversation telemetry for one thread. `threadId` identifies the conversation within your organization — reuse means the same conversation. Messages replace the stored transcript wholesale; `metadata` and model fields only overwrite when present. Last write per thread wins — retries are safe.
|
|
2121
|
+
*/
|
|
2122
|
+
put: operations['saveConversation'];
|
|
2123
|
+
post?: never;
|
|
2124
|
+
delete?: never;
|
|
2125
|
+
options?: never;
|
|
2126
|
+
head?: never;
|
|
2127
|
+
/**
|
|
2128
|
+
* Record a classification verdict
|
|
2129
|
+
* @description Records the classification your own model produced for one thread: exactly one of `coreMetrics` (a verdict — the server stamps `classifiedAt` and clears any recorded failure) or `classificationError` (why classification failed; an earlier verdict stays untouched). No revision guard — like the ingest upsert the writer is an automated classifier, so last write wins and a re-classification simply overwrites.
|
|
2130
|
+
*/
|
|
2131
|
+
patch: operations['classifyConversation'];
|
|
2132
|
+
trace?: never;
|
|
2133
|
+
};
|
|
2134
|
+
}
|
|
2135
|
+
interface components {
|
|
2136
|
+
schemas: {
|
|
2137
|
+
/** @description A `sanity.context.conversation` document, one agent conversation transcript with its classification, stored in the organization store. Not returned by any endpoint raw; published so GROQ reads can be typed. Write through the conversation ingest and classify endpoints, never with a raw client. */
|
|
2138
|
+
ConversationDoc: {
|
|
2139
|
+
_id: string;
|
|
2140
|
+
_rev: string;
|
|
2141
|
+
/** Format: date-time */
|
|
2142
|
+
_createdAt: string;
|
|
2143
|
+
/** Format: date-time */
|
|
2144
|
+
_updatedAt: string;
|
|
2145
|
+
/** @enum {string} */
|
|
2146
|
+
_type: 'sanity.context.conversation';
|
|
2147
|
+
/** @enum {number} */
|
|
2148
|
+
schemaVersion: 1;
|
|
2149
|
+
organizationId: string;
|
|
2150
|
+
threadId: string;
|
|
2151
|
+
/** @description ConversationMetadata */
|
|
2152
|
+
metadata: {
|
|
2153
|
+
[key: string]: string | string[];
|
|
2154
|
+
} | null;
|
|
2155
|
+
/** Format: date-time */
|
|
2156
|
+
startedAt: string;
|
|
2157
|
+
/** Format: date-time */
|
|
2158
|
+
messagesUpdatedAt: string;
|
|
2159
|
+
messages: {
|
|
2160
|
+
/** @enum {string} */
|
|
2161
|
+
role: 'user' | 'assistant' | 'system' | 'tool';
|
|
2162
|
+
/** @default null */
|
|
2163
|
+
content: string | null;
|
|
2164
|
+
/** @default null */
|
|
2165
|
+
toolName: string | null;
|
|
2166
|
+
/**
|
|
2167
|
+
* @default null
|
|
2168
|
+
* @enum {string|null}
|
|
2169
|
+
*/
|
|
2170
|
+
toolType: 'call' | 'result' | null;
|
|
2171
|
+
}[];
|
|
2172
|
+
modelProvider: string | null;
|
|
2173
|
+
modelId: string | null;
|
|
2174
|
+
/** @description ConversationTokenUsage */
|
|
2175
|
+
tokenUsage: {
|
|
2176
|
+
inputTokens?: number;
|
|
2177
|
+
outputTokens?: number;
|
|
2178
|
+
totalTokens?: number;
|
|
2179
|
+
} | null;
|
|
2180
|
+
/** @description ConversationCoreMetrics */
|
|
2181
|
+
coreMetrics: {
|
|
2182
|
+
successScore?: number;
|
|
2183
|
+
/** @enum {string} */
|
|
2184
|
+
sentiment?: 'positive' | 'neutral' | 'negative';
|
|
2185
|
+
contentGaps?: string[];
|
|
2186
|
+
} | null;
|
|
2187
|
+
/** Format: date-time */
|
|
2188
|
+
classifiedAt: string | null;
|
|
2189
|
+
classificationError: string | null;
|
|
2190
|
+
};
|
|
2191
|
+
/** @description A `sanity.context.entry` document, one outline node stored in the bound dataset. Not returned by any endpoint; published so GROQ reads against the dataset can be typed. The entries endpoints serve the validated wire view. */
|
|
2192
|
+
EntryDoc: {
|
|
2193
|
+
_id: string;
|
|
2194
|
+
_rev: string;
|
|
2195
|
+
/** Format: date-time */
|
|
2196
|
+
_createdAt: string;
|
|
2197
|
+
/** Format: date-time */
|
|
2198
|
+
_updatedAt: string;
|
|
2199
|
+
knowledgeBaseId: string;
|
|
2200
|
+
/** @enum {string} */
|
|
2201
|
+
_type: 'sanity.context.entry';
|
|
2202
|
+
schemaVersion: number;
|
|
2203
|
+
revisionId: string;
|
|
2204
|
+
path: string;
|
|
2205
|
+
title: string;
|
|
2206
|
+
tldr?: {
|
|
2207
|
+
scope: string;
|
|
2208
|
+
excludes: string;
|
|
2209
|
+
neighbors?: string[];
|
|
2210
|
+
/** @enum {string} */
|
|
2211
|
+
centrality: 'core' | 'standard' | 'peripheral';
|
|
2212
|
+
};
|
|
2213
|
+
body?: string;
|
|
2214
|
+
topicHeadings?: string[];
|
|
2215
|
+
citations?: {
|
|
2216
|
+
sourceId: string;
|
|
2217
|
+
supports?: string;
|
|
2218
|
+
spans?: {
|
|
2219
|
+
sourceLineStart: number;
|
|
2220
|
+
sourceLineEnd: number;
|
|
2221
|
+
quote: string;
|
|
2222
|
+
}[];
|
|
2223
|
+
claim?: {
|
|
2224
|
+
exact: string;
|
|
2225
|
+
prefix?: string;
|
|
2226
|
+
suffix?: string;
|
|
2227
|
+
};
|
|
2228
|
+
/** @enum {string} */
|
|
2229
|
+
groundingState?: 'drifted';
|
|
2230
|
+
_key: string;
|
|
2231
|
+
/** @enum {string} */
|
|
2232
|
+
_type: 'sanity.context.citation';
|
|
2233
|
+
filename: string;
|
|
2234
|
+
mime?: string;
|
|
2235
|
+
excerpt?: string;
|
|
2236
|
+
}[];
|
|
2237
|
+
/** @enum {string} */
|
|
2238
|
+
status: 'virtual' | 'outlined' | 'filled' | 'stale' | 'generation_failed';
|
|
2239
|
+
generatedAt: string;
|
|
2240
|
+
};
|
|
2241
|
+
/** @description A `sanity.context.instruction` document, a standing decision steering every build, stored in the bound dataset. Not returned by any endpoint; published so GROQ reads against the dataset can be typed. Write through the instructions endpoints, never with a raw client. */
|
|
2242
|
+
InstructionDoc: {
|
|
2243
|
+
_id: string;
|
|
2244
|
+
_rev: string;
|
|
2245
|
+
/** Format: date-time */
|
|
2246
|
+
_createdAt: string;
|
|
2247
|
+
/** Format: date-time */
|
|
2248
|
+
_updatedAt: string;
|
|
2249
|
+
knowledgeBaseId: string;
|
|
2250
|
+
/** @enum {string} */
|
|
2251
|
+
_type: 'sanity.context.instruction';
|
|
2252
|
+
/** @enum {number} */
|
|
2253
|
+
schemaVersion: 1;
|
|
2254
|
+
statement: string;
|
|
2255
|
+
scopeSources: {
|
|
2256
|
+
_key: string;
|
|
2257
|
+
sourceId: string;
|
|
2258
|
+
contentHash: string;
|
|
2259
|
+
}[] | null;
|
|
2260
|
+
/** @enum {string} */
|
|
2261
|
+
status: 'active' | 'archived';
|
|
2262
|
+
archivedAt: string | null;
|
|
2263
|
+
archivedReason: string | null;
|
|
2264
|
+
/** @enum {string} */
|
|
2265
|
+
origin: 'conflict';
|
|
2266
|
+
sourceIssueId: string;
|
|
2267
|
+
} | {
|
|
2268
|
+
_id: string;
|
|
2269
|
+
_rev: string;
|
|
2270
|
+
/** Format: date-time */
|
|
2271
|
+
_createdAt: string;
|
|
2272
|
+
/** Format: date-time */
|
|
2273
|
+
_updatedAt: string;
|
|
2274
|
+
knowledgeBaseId: string;
|
|
2275
|
+
/** @enum {string} */
|
|
2276
|
+
_type: 'sanity.context.instruction';
|
|
2277
|
+
/** @enum {number} */
|
|
2278
|
+
schemaVersion: 1;
|
|
2279
|
+
statement: string;
|
|
2280
|
+
scopeSources: {
|
|
2281
|
+
_key: string;
|
|
2282
|
+
sourceId: string;
|
|
2283
|
+
contentHash: string;
|
|
2284
|
+
}[] | null;
|
|
2285
|
+
/** @enum {string} */
|
|
2286
|
+
status: 'active' | 'archived';
|
|
2287
|
+
archivedAt: string | null;
|
|
2288
|
+
archivedReason: string | null;
|
|
2289
|
+
/** @enum {string} */
|
|
2290
|
+
origin: 'human';
|
|
2291
|
+
/** @enum {string|null} */
|
|
2292
|
+
sourceIssueId: null;
|
|
2293
|
+
};
|
|
2294
|
+
/** @description A `sanity.context.issue` document, a build finding awaiting triage, stored in the bound dataset. Not returned by any endpoint; published so GROQ reads and trigger filters can be typed. Status transitions flow through the issues endpoints, which own the state machine. One invariant the schema cannot express: only a `conflict` issue ever carries a non-null `resolution`. */
|
|
2295
|
+
IssueDoc: {
|
|
2296
|
+
_id: string;
|
|
2297
|
+
_rev: string;
|
|
2298
|
+
/** Format: date-time */
|
|
2299
|
+
_createdAt: string;
|
|
2300
|
+
/** Format: date-time */
|
|
2301
|
+
_updatedAt: string;
|
|
2302
|
+
knowledgeBaseId: string;
|
|
2303
|
+
/** @enum {string} */
|
|
2304
|
+
_type: 'sanity.context.issue';
|
|
2305
|
+
/** @enum {number} */
|
|
2306
|
+
schemaVersion: 1;
|
|
2307
|
+
/** @description IssueContent */
|
|
2308
|
+
content: {
|
|
2309
|
+
/** @enum {string} */
|
|
2310
|
+
kind: 'conflict' | 'gap' | 'update_required' | 'add_entry' | 'remove_entry' | 'split_entry' | 'merge_entry';
|
|
2311
|
+
/** @enum {string} */
|
|
2312
|
+
severity: 'critical' | 'suggestion';
|
|
2313
|
+
scopePath: string;
|
|
2314
|
+
issue: string;
|
|
2315
|
+
suggestedFix: string;
|
|
2316
|
+
citedSourceIds?: string[];
|
|
2317
|
+
claimKey?: string;
|
|
2318
|
+
involvedScopes?: string[];
|
|
2319
|
+
currentClaim?: string;
|
|
2320
|
+
alternativeClaim?: string;
|
|
2321
|
+
/** @enum {string} */
|
|
2322
|
+
currentAuthority?: 'primary' | 'secondary' | 'community';
|
|
2323
|
+
/** @enum {string} */
|
|
2324
|
+
alternativeAuthority?: 'primary' | 'secondary' | 'community';
|
|
2325
|
+
/** @enum {string} */
|
|
2326
|
+
suggestedResolution?: 'keep_existing' | 'accept_new';
|
|
2327
|
+
};
|
|
2328
|
+
fingerprint: string;
|
|
2329
|
+
revisionId: string | null;
|
|
2330
|
+
/** @enum {string} */
|
|
2331
|
+
status: 'open';
|
|
2332
|
+
/** @enum {string|null} */
|
|
2333
|
+
resolution: null;
|
|
2334
|
+
/** @enum {string|null} */
|
|
2335
|
+
resolvedAt: null;
|
|
2336
|
+
/** @enum {string|null} */
|
|
2337
|
+
resolvedBy: null;
|
|
2338
|
+
} | {
|
|
2339
|
+
_id: string;
|
|
2340
|
+
_rev: string;
|
|
2341
|
+
/** Format: date-time */
|
|
2342
|
+
_createdAt: string;
|
|
2343
|
+
/** Format: date-time */
|
|
2344
|
+
_updatedAt: string;
|
|
2345
|
+
knowledgeBaseId: string;
|
|
2346
|
+
/** @enum {string} */
|
|
2347
|
+
_type: 'sanity.context.issue';
|
|
2348
|
+
/** @enum {number} */
|
|
2349
|
+
schemaVersion: 1;
|
|
2350
|
+
/** @description IssueContent */
|
|
2351
|
+
content: {
|
|
2352
|
+
/** @enum {string} */
|
|
2353
|
+
kind: 'conflict' | 'gap' | 'update_required' | 'add_entry' | 'remove_entry' | 'split_entry' | 'merge_entry';
|
|
2354
|
+
/** @enum {string} */
|
|
2355
|
+
severity: 'critical' | 'suggestion';
|
|
2356
|
+
scopePath: string;
|
|
2357
|
+
issue: string;
|
|
2358
|
+
suggestedFix: string;
|
|
2359
|
+
citedSourceIds?: string[];
|
|
2360
|
+
claimKey?: string;
|
|
2361
|
+
involvedScopes?: string[];
|
|
2362
|
+
currentClaim?: string;
|
|
2363
|
+
alternativeClaim?: string;
|
|
2364
|
+
/** @enum {string} */
|
|
2365
|
+
currentAuthority?: 'primary' | 'secondary' | 'community';
|
|
2366
|
+
/** @enum {string} */
|
|
2367
|
+
alternativeAuthority?: 'primary' | 'secondary' | 'community';
|
|
2368
|
+
/** @enum {string} */
|
|
2369
|
+
suggestedResolution?: 'keep_existing' | 'accept_new';
|
|
2370
|
+
};
|
|
2371
|
+
fingerprint: string;
|
|
2372
|
+
revisionId: string | null;
|
|
2373
|
+
/** @enum {string} */
|
|
2374
|
+
status: 'accepted';
|
|
2375
|
+
/** Format: date-time */
|
|
2376
|
+
resolvedAt: string;
|
|
2377
|
+
resolvedBy: {
|
|
2378
|
+
id: string;
|
|
2379
|
+
/** @enum {string} */
|
|
2380
|
+
kind: 'user' | 'robot';
|
|
2381
|
+
} | null;
|
|
2382
|
+
/** @enum {string|null} */
|
|
2383
|
+
resolution: 'keep_existing' | 'accept_new' | null;
|
|
2384
|
+
} | {
|
|
2385
|
+
_id: string;
|
|
2386
|
+
_rev: string;
|
|
2387
|
+
/** Format: date-time */
|
|
2388
|
+
_createdAt: string;
|
|
2389
|
+
/** Format: date-time */
|
|
2390
|
+
_updatedAt: string;
|
|
2391
|
+
knowledgeBaseId: string;
|
|
2392
|
+
/** @enum {string} */
|
|
2393
|
+
_type: 'sanity.context.issue';
|
|
2394
|
+
/** @enum {number} */
|
|
2395
|
+
schemaVersion: 1;
|
|
2396
|
+
/** @description IssueContent */
|
|
2397
|
+
content: {
|
|
2398
|
+
/** @enum {string} */
|
|
2399
|
+
kind: 'conflict' | 'gap' | 'update_required' | 'add_entry' | 'remove_entry' | 'split_entry' | 'merge_entry';
|
|
2400
|
+
/** @enum {string} */
|
|
2401
|
+
severity: 'critical' | 'suggestion';
|
|
2402
|
+
scopePath: string;
|
|
2403
|
+
issue: string;
|
|
2404
|
+
suggestedFix: string;
|
|
2405
|
+
citedSourceIds?: string[];
|
|
2406
|
+
claimKey?: string;
|
|
2407
|
+
involvedScopes?: string[];
|
|
2408
|
+
currentClaim?: string;
|
|
2409
|
+
alternativeClaim?: string;
|
|
2410
|
+
/** @enum {string} */
|
|
2411
|
+
currentAuthority?: 'primary' | 'secondary' | 'community';
|
|
2412
|
+
/** @enum {string} */
|
|
2413
|
+
alternativeAuthority?: 'primary' | 'secondary' | 'community';
|
|
2414
|
+
/** @enum {string} */
|
|
2415
|
+
suggestedResolution?: 'keep_existing' | 'accept_new';
|
|
2416
|
+
};
|
|
2417
|
+
fingerprint: string;
|
|
2418
|
+
revisionId: string | null;
|
|
2419
|
+
/** @enum {string} */
|
|
2420
|
+
status: 'rejected';
|
|
2421
|
+
/** Format: date-time */
|
|
2422
|
+
resolvedAt: string;
|
|
2423
|
+
resolvedBy: {
|
|
2424
|
+
id: string;
|
|
2425
|
+
/** @enum {string} */
|
|
2426
|
+
kind: 'user' | 'robot';
|
|
2427
|
+
} | null;
|
|
2428
|
+
/** @enum {string|null} */
|
|
2429
|
+
resolution: null;
|
|
2430
|
+
};
|
|
2431
|
+
/** @description A `sanity.context.mcp` document, an org-owned MCP endpoint configuration stored in the organization store. Not returned by any endpoint raw; published so GROQ reads and trigger filters can be typed. Write through the mcp endpoints, never with a raw client. The mcp endpoints serve the validated wire view. */
|
|
2432
|
+
McpDoc: {
|
|
2433
|
+
_id: string;
|
|
2434
|
+
_rev: string;
|
|
2435
|
+
/** Format: date-time */
|
|
2436
|
+
_createdAt: string;
|
|
2437
|
+
/** Format: date-time */
|
|
2438
|
+
_updatedAt: string;
|
|
2439
|
+
/** @enum {string} */
|
|
2440
|
+
_type: 'sanity.context.mcp';
|
|
2441
|
+
/** @enum {number} */
|
|
2442
|
+
schemaVersion: 1;
|
|
2443
|
+
organizationId: string;
|
|
2444
|
+
publicId: string;
|
|
2445
|
+
title: string;
|
|
2446
|
+
name: string;
|
|
2447
|
+
sources: ({
|
|
2448
|
+
/** @enum {string} */
|
|
2449
|
+
type: 'knowledge-base';
|
|
2450
|
+
id: string;
|
|
2451
|
+
} | {
|
|
2452
|
+
/** @enum {string} */
|
|
2453
|
+
type: 'dataset';
|
|
2454
|
+
id: string;
|
|
2455
|
+
})[];
|
|
2456
|
+
instructions: string | null;
|
|
2457
|
+
groqFilter: string | null;
|
|
2458
|
+
};
|
|
2459
|
+
};
|
|
2460
|
+
responses: never;
|
|
2461
|
+
parameters: never;
|
|
2462
|
+
requestBodies: never;
|
|
2463
|
+
headers: never;
|
|
2464
|
+
pathItems: never;
|
|
2465
|
+
}
|
|
2466
|
+
interface operations {
|
|
2467
|
+
listKnowledgeBases: {
|
|
2468
|
+
parameters: {
|
|
2469
|
+
query: {
|
|
2470
|
+
cursor?: string;
|
|
2471
|
+
limit?: number;
|
|
2472
|
+
organizationId: string;
|
|
2473
|
+
};
|
|
2474
|
+
header?: never;
|
|
2475
|
+
path: {
|
|
2476
|
+
apiVersion: string;
|
|
2477
|
+
};
|
|
2478
|
+
cookie?: never;
|
|
2479
|
+
};
|
|
2480
|
+
requestBody?: never;
|
|
2481
|
+
responses: {
|
|
2482
|
+
/** @description Default Response */
|
|
2483
|
+
200: {
|
|
2484
|
+
headers: {
|
|
2485
|
+
[name: string]: unknown;
|
|
2486
|
+
};
|
|
2487
|
+
content: {
|
|
2488
|
+
'application/json': {
|
|
2489
|
+
data: {
|
|
2490
|
+
/** Format: uuid */
|
|
2491
|
+
id: string;
|
|
2492
|
+
publicId: string;
|
|
2493
|
+
organizationId: string;
|
|
2494
|
+
title: string;
|
|
2495
|
+
description: string;
|
|
2496
|
+
/** @enum {string} */
|
|
2497
|
+
state: 'created' | 'building' | 'ready' | 'review' | 'stale' | 'paused';
|
|
2498
|
+
activeJobId: string | null;
|
|
2499
|
+
isBuilding: boolean;
|
|
2500
|
+
buildStageState: {
|
|
2501
|
+
jobId: string;
|
|
2502
|
+
stages: {
|
|
2503
|
+
/** @enum {string} */
|
|
2504
|
+
id: 'tldr' | 'map' | 'triage' | 'plan' | 'organize' | 'arrange' | 'write' | 'review' | 'polish';
|
|
2505
|
+
/** @enum {string} */
|
|
2506
|
+
status: 'pending' | 'running' | 'done' | 'failed';
|
|
2507
|
+
units?: {
|
|
2508
|
+
/** @enum {string} */
|
|
2509
|
+
unit: 'sources' | 'groups' | 'entries' | 'rounds';
|
|
2510
|
+
done: number;
|
|
2511
|
+
total?: number;
|
|
2512
|
+
};
|
|
2513
|
+
}[];
|
|
2514
|
+
} | null;
|
|
2515
|
+
/** Format: date-time */
|
|
2516
|
+
lastCheckedAt: string | null;
|
|
2517
|
+
/** Format: date-time */
|
|
2518
|
+
lastChangedAt: string | null;
|
|
2519
|
+
hasPendingChanges: boolean;
|
|
2520
|
+
pendingChanges: {
|
|
2521
|
+
added: number;
|
|
2522
|
+
changed: number;
|
|
2523
|
+
removed: number;
|
|
2524
|
+
} | null;
|
|
2525
|
+
pipelineOutdated: boolean;
|
|
2526
|
+
rebuildRecommended: {
|
|
2527
|
+
reason: string;
|
|
2528
|
+
/** Format: date-time */
|
|
2529
|
+
at: string;
|
|
2530
|
+
} | null;
|
|
2531
|
+
hasWebSource: boolean;
|
|
2532
|
+
hasDatasetSource: boolean;
|
|
2533
|
+
sourceUsage: {
|
|
2534
|
+
used: number;
|
|
2535
|
+
limit: number;
|
|
2536
|
+
} | null;
|
|
2537
|
+
refreshEnabled: boolean;
|
|
2538
|
+
/** @enum {string} */
|
|
2539
|
+
refreshFrequency: 'weekly' | 'monthly';
|
|
2540
|
+
/** Format: date-time */
|
|
2541
|
+
refreshNextRunAt: string | null;
|
|
2542
|
+
refreshInFlight: boolean;
|
|
2543
|
+
openIssueCount: number;
|
|
2544
|
+
instructionCount: number;
|
|
2545
|
+
/** Format: date-time */
|
|
2546
|
+
createdAt: string;
|
|
2547
|
+
/** Format: date-time */
|
|
2548
|
+
updatedAt: string;
|
|
2549
|
+
}[];
|
|
2550
|
+
nextCursor: string | null;
|
|
2551
|
+
};
|
|
2552
|
+
};
|
|
2553
|
+
};
|
|
2554
|
+
};
|
|
2555
|
+
};
|
|
2556
|
+
createKnowledgeBase: {
|
|
2557
|
+
parameters: {
|
|
2558
|
+
query?: never;
|
|
2559
|
+
header?: never;
|
|
2560
|
+
path: {
|
|
2561
|
+
apiVersion: string;
|
|
2562
|
+
};
|
|
2563
|
+
cookie?: never;
|
|
2564
|
+
};
|
|
2565
|
+
requestBody: {
|
|
2566
|
+
content: {
|
|
2567
|
+
'application/json': {
|
|
2568
|
+
organizationId: string;
|
|
2569
|
+
title: string;
|
|
2570
|
+
description: string;
|
|
2571
|
+
};
|
|
2572
|
+
};
|
|
2573
|
+
};
|
|
2574
|
+
responses: {
|
|
2575
|
+
/** @description KnowledgeBase */
|
|
2576
|
+
201: {
|
|
2577
|
+
headers: {
|
|
2578
|
+
[name: string]: unknown;
|
|
2579
|
+
};
|
|
2580
|
+
content: {
|
|
2581
|
+
'application/json': {
|
|
2582
|
+
/** Format: uuid */
|
|
2583
|
+
id: string;
|
|
2584
|
+
publicId: string;
|
|
2585
|
+
organizationId: string;
|
|
2586
|
+
title: string;
|
|
2587
|
+
description: string;
|
|
2588
|
+
/** @enum {string} */
|
|
2589
|
+
state: 'created' | 'building' | 'ready' | 'review' | 'stale' | 'paused';
|
|
2590
|
+
activeJobId: string | null;
|
|
2591
|
+
isBuilding: boolean;
|
|
2592
|
+
buildStageState: {
|
|
2593
|
+
jobId: string;
|
|
2594
|
+
stages: {
|
|
2595
|
+
/** @enum {string} */
|
|
2596
|
+
id: 'tldr' | 'map' | 'triage' | 'plan' | 'organize' | 'arrange' | 'write' | 'review' | 'polish';
|
|
2597
|
+
/** @enum {string} */
|
|
2598
|
+
status: 'pending' | 'running' | 'done' | 'failed';
|
|
2599
|
+
units?: {
|
|
2600
|
+
/** @enum {string} */
|
|
2601
|
+
unit: 'sources' | 'groups' | 'entries' | 'rounds';
|
|
2602
|
+
done: number;
|
|
2603
|
+
total?: number;
|
|
2604
|
+
};
|
|
2605
|
+
}[];
|
|
2606
|
+
} | null;
|
|
2607
|
+
/** Format: date-time */
|
|
2608
|
+
lastCheckedAt: string | null;
|
|
2609
|
+
/** Format: date-time */
|
|
2610
|
+
lastChangedAt: string | null;
|
|
2611
|
+
hasPendingChanges: boolean;
|
|
2612
|
+
pendingChanges: {
|
|
2613
|
+
added: number;
|
|
2614
|
+
changed: number;
|
|
2615
|
+
removed: number;
|
|
2616
|
+
} | null;
|
|
2617
|
+
pipelineOutdated: boolean;
|
|
2618
|
+
rebuildRecommended: {
|
|
2619
|
+
reason: string;
|
|
2620
|
+
/** Format: date-time */
|
|
2621
|
+
at: string;
|
|
2622
|
+
} | null;
|
|
2623
|
+
hasWebSource: boolean;
|
|
2624
|
+
hasDatasetSource: boolean;
|
|
2625
|
+
sourceUsage: {
|
|
2626
|
+
used: number;
|
|
2627
|
+
limit: number;
|
|
2628
|
+
} | null;
|
|
2629
|
+
refreshEnabled: boolean;
|
|
2630
|
+
/** @enum {string} */
|
|
2631
|
+
refreshFrequency: 'weekly' | 'monthly';
|
|
2632
|
+
/** Format: date-time */
|
|
2633
|
+
refreshNextRunAt: string | null;
|
|
2634
|
+
refreshInFlight: boolean;
|
|
2635
|
+
openIssueCount: number;
|
|
2636
|
+
instructionCount: number;
|
|
2637
|
+
/** Format: date-time */
|
|
2638
|
+
createdAt: string;
|
|
2639
|
+
/** Format: date-time */
|
|
2640
|
+
updatedAt: string;
|
|
2641
|
+
};
|
|
2642
|
+
};
|
|
2643
|
+
};
|
|
2644
|
+
};
|
|
2645
|
+
};
|
|
2646
|
+
getKnowledgeBase: {
|
|
2647
|
+
parameters: {
|
|
2648
|
+
query?: never;
|
|
2649
|
+
header?: never;
|
|
2650
|
+
path: {
|
|
2651
|
+
knowledgeBaseId: string;
|
|
2652
|
+
};
|
|
2653
|
+
cookie?: never;
|
|
2654
|
+
};
|
|
2655
|
+
requestBody?: never;
|
|
2656
|
+
responses: {
|
|
2657
|
+
/** @description KnowledgeBase */
|
|
2658
|
+
200: {
|
|
2659
|
+
headers: {
|
|
2660
|
+
[name: string]: unknown;
|
|
2661
|
+
};
|
|
2662
|
+
content: {
|
|
2663
|
+
'application/json': {
|
|
2664
|
+
/** Format: uuid */
|
|
2665
|
+
id: string;
|
|
2666
|
+
publicId: string;
|
|
2667
|
+
organizationId: string;
|
|
2668
|
+
title: string;
|
|
2669
|
+
description: string;
|
|
2670
|
+
/** @enum {string} */
|
|
2671
|
+
state: 'created' | 'building' | 'ready' | 'review' | 'stale' | 'paused';
|
|
2672
|
+
activeJobId: string | null;
|
|
2673
|
+
isBuilding: boolean;
|
|
2674
|
+
buildStageState: {
|
|
2675
|
+
jobId: string;
|
|
2676
|
+
stages: {
|
|
2677
|
+
/** @enum {string} */
|
|
2678
|
+
id: 'tldr' | 'map' | 'triage' | 'plan' | 'organize' | 'arrange' | 'write' | 'review' | 'polish';
|
|
2679
|
+
/** @enum {string} */
|
|
2680
|
+
status: 'pending' | 'running' | 'done' | 'failed';
|
|
2681
|
+
units?: {
|
|
2682
|
+
/** @enum {string} */
|
|
2683
|
+
unit: 'sources' | 'groups' | 'entries' | 'rounds';
|
|
2684
|
+
done: number;
|
|
2685
|
+
total?: number;
|
|
2686
|
+
};
|
|
2687
|
+
}[];
|
|
2688
|
+
} | null;
|
|
2689
|
+
/** Format: date-time */
|
|
2690
|
+
lastCheckedAt: string | null;
|
|
2691
|
+
/** Format: date-time */
|
|
2692
|
+
lastChangedAt: string | null;
|
|
2693
|
+
hasPendingChanges: boolean;
|
|
2694
|
+
pendingChanges: {
|
|
2695
|
+
added: number;
|
|
2696
|
+
changed: number;
|
|
2697
|
+
removed: number;
|
|
2698
|
+
} | null;
|
|
2699
|
+
pipelineOutdated: boolean;
|
|
2700
|
+
rebuildRecommended: {
|
|
2701
|
+
reason: string;
|
|
2702
|
+
/** Format: date-time */
|
|
2703
|
+
at: string;
|
|
2704
|
+
} | null;
|
|
2705
|
+
hasWebSource: boolean;
|
|
2706
|
+
hasDatasetSource: boolean;
|
|
2707
|
+
sourceUsage: {
|
|
2708
|
+
used: number;
|
|
2709
|
+
limit: number;
|
|
2710
|
+
} | null;
|
|
2711
|
+
refreshEnabled: boolean;
|
|
2712
|
+
/** @enum {string} */
|
|
2713
|
+
refreshFrequency: 'weekly' | 'monthly';
|
|
2714
|
+
/** Format: date-time */
|
|
2715
|
+
refreshNextRunAt: string | null;
|
|
2716
|
+
refreshInFlight: boolean;
|
|
2717
|
+
openIssueCount: number;
|
|
2718
|
+
instructionCount: number;
|
|
2719
|
+
/** Format: date-time */
|
|
2720
|
+
createdAt: string;
|
|
2721
|
+
/** Format: date-time */
|
|
2722
|
+
updatedAt: string;
|
|
2723
|
+
};
|
|
2724
|
+
};
|
|
2725
|
+
};
|
|
2726
|
+
};
|
|
2727
|
+
};
|
|
2728
|
+
deleteKnowledgeBase: {
|
|
2729
|
+
parameters: {
|
|
2730
|
+
query?: never;
|
|
2731
|
+
header?: never;
|
|
2732
|
+
path: {
|
|
2733
|
+
knowledgeBaseId: string;
|
|
2734
|
+
};
|
|
2735
|
+
cookie?: never;
|
|
2736
|
+
};
|
|
2737
|
+
requestBody?: never;
|
|
2738
|
+
responses: {
|
|
2739
|
+
/** @description Default Response */
|
|
2740
|
+
204: {
|
|
2741
|
+
headers: {
|
|
2742
|
+
[name: string]: unknown;
|
|
2743
|
+
};
|
|
2744
|
+
content: {
|
|
2745
|
+
'application/json': null;
|
|
2746
|
+
};
|
|
2747
|
+
};
|
|
2748
|
+
};
|
|
2749
|
+
};
|
|
2750
|
+
updateKnowledgeBase: {
|
|
2751
|
+
parameters: {
|
|
2752
|
+
query?: never;
|
|
2753
|
+
header?: never;
|
|
2754
|
+
path: {
|
|
2755
|
+
knowledgeBaseId: string;
|
|
2756
|
+
};
|
|
2757
|
+
cookie?: never;
|
|
2758
|
+
};
|
|
2759
|
+
requestBody: {
|
|
2760
|
+
content: {
|
|
2761
|
+
'application/json': {
|
|
2762
|
+
title?: string;
|
|
2763
|
+
description?: string;
|
|
2764
|
+
refreshEnabled?: boolean;
|
|
2765
|
+
/** @enum {string} */
|
|
2766
|
+
refreshFrequency?: 'weekly' | 'monthly';
|
|
2767
|
+
};
|
|
2768
|
+
};
|
|
2769
|
+
};
|
|
2770
|
+
responses: {
|
|
2771
|
+
/** @description KnowledgeBase */
|
|
2772
|
+
200: {
|
|
2773
|
+
headers: {
|
|
2774
|
+
[name: string]: unknown;
|
|
2775
|
+
};
|
|
2776
|
+
content: {
|
|
2777
|
+
'application/json': {
|
|
2778
|
+
/** Format: uuid */
|
|
2779
|
+
id: string;
|
|
2780
|
+
publicId: string;
|
|
2781
|
+
organizationId: string;
|
|
2782
|
+
title: string;
|
|
2783
|
+
description: string;
|
|
2784
|
+
/** @enum {string} */
|
|
2785
|
+
state: 'created' | 'building' | 'ready' | 'review' | 'stale' | 'paused';
|
|
2786
|
+
activeJobId: string | null;
|
|
2787
|
+
isBuilding: boolean;
|
|
2788
|
+
buildStageState: {
|
|
2789
|
+
jobId: string;
|
|
2790
|
+
stages: {
|
|
2791
|
+
/** @enum {string} */
|
|
2792
|
+
id: 'tldr' | 'map' | 'triage' | 'plan' | 'organize' | 'arrange' | 'write' | 'review' | 'polish';
|
|
2793
|
+
/** @enum {string} */
|
|
2794
|
+
status: 'pending' | 'running' | 'done' | 'failed';
|
|
2795
|
+
units?: {
|
|
2796
|
+
/** @enum {string} */
|
|
2797
|
+
unit: 'sources' | 'groups' | 'entries' | 'rounds';
|
|
2798
|
+
done: number;
|
|
2799
|
+
total?: number;
|
|
2800
|
+
};
|
|
2801
|
+
}[];
|
|
2802
|
+
} | null;
|
|
2803
|
+
/** Format: date-time */
|
|
2804
|
+
lastCheckedAt: string | null;
|
|
2805
|
+
/** Format: date-time */
|
|
2806
|
+
lastChangedAt: string | null;
|
|
2807
|
+
hasPendingChanges: boolean;
|
|
2808
|
+
pendingChanges: {
|
|
2809
|
+
added: number;
|
|
2810
|
+
changed: number;
|
|
2811
|
+
removed: number;
|
|
2812
|
+
} | null;
|
|
2813
|
+
pipelineOutdated: boolean;
|
|
2814
|
+
rebuildRecommended: {
|
|
2815
|
+
reason: string;
|
|
2816
|
+
/** Format: date-time */
|
|
2817
|
+
at: string;
|
|
2818
|
+
} | null;
|
|
2819
|
+
hasWebSource: boolean;
|
|
2820
|
+
hasDatasetSource: boolean;
|
|
2821
|
+
sourceUsage: {
|
|
2822
|
+
used: number;
|
|
2823
|
+
limit: number;
|
|
2824
|
+
} | null;
|
|
2825
|
+
refreshEnabled: boolean;
|
|
2826
|
+
/** @enum {string} */
|
|
2827
|
+
refreshFrequency: 'weekly' | 'monthly';
|
|
2828
|
+
/** Format: date-time */
|
|
2829
|
+
refreshNextRunAt: string | null;
|
|
2830
|
+
refreshInFlight: boolean;
|
|
2831
|
+
openIssueCount: number;
|
|
2832
|
+
instructionCount: number;
|
|
2833
|
+
/** Format: date-time */
|
|
2834
|
+
createdAt: string;
|
|
2835
|
+
/** Format: date-time */
|
|
2836
|
+
updatedAt: string;
|
|
2837
|
+
};
|
|
2838
|
+
};
|
|
2839
|
+
};
|
|
2840
|
+
};
|
|
2841
|
+
};
|
|
2842
|
+
buildKnowledgeBase: {
|
|
2843
|
+
parameters: {
|
|
2844
|
+
query?: never;
|
|
2845
|
+
header?: never;
|
|
2846
|
+
path: {
|
|
2847
|
+
knowledgeBaseId: string;
|
|
2848
|
+
};
|
|
2849
|
+
cookie?: never;
|
|
2850
|
+
};
|
|
2851
|
+
requestBody?: never;
|
|
2852
|
+
responses: {
|
|
2853
|
+
/** @description JobAccepted */
|
|
2854
|
+
202: {
|
|
2855
|
+
headers: {
|
|
2856
|
+
[name: string]: unknown;
|
|
2857
|
+
};
|
|
2858
|
+
content: {
|
|
2859
|
+
'application/json': {
|
|
2860
|
+
jobId: string;
|
|
2861
|
+
};
|
|
2862
|
+
};
|
|
2863
|
+
};
|
|
2864
|
+
};
|
|
2865
|
+
};
|
|
2866
|
+
cancelKnowledgeBaseBuild: {
|
|
2867
|
+
parameters: {
|
|
2868
|
+
query?: never;
|
|
2869
|
+
header?: never;
|
|
2870
|
+
path: {
|
|
2871
|
+
knowledgeBaseId: string;
|
|
2872
|
+
};
|
|
2873
|
+
cookie?: never;
|
|
2874
|
+
};
|
|
2875
|
+
requestBody?: never;
|
|
2876
|
+
responses: {
|
|
2877
|
+
/** @description Default Response */
|
|
2878
|
+
200: {
|
|
2879
|
+
headers: {
|
|
2880
|
+
[name: string]: unknown;
|
|
2881
|
+
};
|
|
2882
|
+
content: {
|
|
2883
|
+
'application/json': {
|
|
2884
|
+
cancelled: boolean;
|
|
2885
|
+
};
|
|
2886
|
+
};
|
|
2887
|
+
};
|
|
2888
|
+
};
|
|
2889
|
+
};
|
|
2890
|
+
rebuildEntry: {
|
|
2891
|
+
parameters: {
|
|
2892
|
+
query?: never;
|
|
2893
|
+
header?: never;
|
|
2894
|
+
path: {
|
|
2895
|
+
knowledgeBaseId: string;
|
|
2896
|
+
entryPath: string;
|
|
2897
|
+
};
|
|
2898
|
+
cookie?: never;
|
|
2899
|
+
};
|
|
2900
|
+
requestBody?: never;
|
|
2901
|
+
responses: {
|
|
2902
|
+
/** @description RebuildEntryResponse */
|
|
2903
|
+
202: {
|
|
2904
|
+
headers: {
|
|
2905
|
+
[name: string]: unknown;
|
|
2906
|
+
};
|
|
2907
|
+
content: {
|
|
2908
|
+
'application/json': {
|
|
2909
|
+
jobId: string;
|
|
2910
|
+
affectedEntries: {
|
|
2911
|
+
id: string;
|
|
2912
|
+
path: string;
|
|
2913
|
+
title: string;
|
|
2914
|
+
}[];
|
|
2915
|
+
};
|
|
2916
|
+
};
|
|
2917
|
+
};
|
|
2918
|
+
};
|
|
2919
|
+
};
|
|
2920
|
+
listImports: {
|
|
2921
|
+
parameters: {
|
|
2922
|
+
query?: {
|
|
2923
|
+
cursor?: string;
|
|
2924
|
+
limit?: number;
|
|
2925
|
+
};
|
|
2926
|
+
header?: never;
|
|
2927
|
+
path: {
|
|
2928
|
+
knowledgeBaseId: string;
|
|
2929
|
+
};
|
|
2930
|
+
cookie?: never;
|
|
2931
|
+
};
|
|
2932
|
+
requestBody?: never;
|
|
2933
|
+
responses: {
|
|
2934
|
+
/** @description Default Response */
|
|
2935
|
+
200: {
|
|
2936
|
+
headers: {
|
|
2937
|
+
[name: string]: unknown;
|
|
2938
|
+
};
|
|
2939
|
+
content: {
|
|
2940
|
+
'application/json': {
|
|
2941
|
+
data: {
|
|
2942
|
+
/** Format: uuid */
|
|
2943
|
+
id: string;
|
|
2944
|
+
/** Format: uuid */
|
|
2945
|
+
knowledgeBaseId: string;
|
|
2946
|
+
name: string | null;
|
|
2947
|
+
sizeBytes: number | null;
|
|
2948
|
+
/** @enum {string} */
|
|
2949
|
+
status: 'uploading' | 'processing' | 'complete' | 'failed';
|
|
2950
|
+
/** @enum {string} */
|
|
2951
|
+
sourceKind: 'web' | 'file' | 'dataset';
|
|
2952
|
+
/** Format: date-time */
|
|
2953
|
+
lastCheckedAt: string | null;
|
|
2954
|
+
sourceCount: number;
|
|
2955
|
+
totalDistillableCount: number;
|
|
2956
|
+
distilledCount: number;
|
|
2957
|
+
unsupportedCount: number;
|
|
2958
|
+
statusDetail: string | null;
|
|
2959
|
+
error: string | null;
|
|
2960
|
+
/** @description CrawlOptions */
|
|
2961
|
+
crawlOptions: {
|
|
2962
|
+
includePaths?: string[];
|
|
2963
|
+
excludePaths?: string[];
|
|
2964
|
+
maxDepth?: number;
|
|
2965
|
+
sitemapOnly?: boolean;
|
|
2966
|
+
ignoreQueryParameters?: boolean;
|
|
2967
|
+
pageLimit?: number;
|
|
2968
|
+
} | null;
|
|
2969
|
+
/** @description DatasetSourceBinding */
|
|
2970
|
+
datasetSource: {
|
|
2971
|
+
sanityProjectId: string;
|
|
2972
|
+
sanityDatasetId: string;
|
|
2973
|
+
query: string;
|
|
2974
|
+
} | null;
|
|
2975
|
+
/** @description Actor */
|
|
2976
|
+
createdBy: {
|
|
2977
|
+
id: string | null;
|
|
2978
|
+
displayName: string | null;
|
|
2979
|
+
} | null;
|
|
2980
|
+
/** Format: date-time */
|
|
2981
|
+
createdAt: string;
|
|
2982
|
+
/** Format: date-time */
|
|
2983
|
+
completedAt: string | null;
|
|
2984
|
+
}[];
|
|
2985
|
+
nextCursor: string | null;
|
|
2986
|
+
};
|
|
2987
|
+
};
|
|
2988
|
+
};
|
|
2989
|
+
};
|
|
2990
|
+
};
|
|
2991
|
+
createImport: {
|
|
2992
|
+
parameters: {
|
|
2993
|
+
query?: never;
|
|
2994
|
+
header?: never;
|
|
2995
|
+
path: {
|
|
2996
|
+
knowledgeBaseId: string;
|
|
2997
|
+
};
|
|
2998
|
+
cookie?: never;
|
|
2999
|
+
};
|
|
3000
|
+
/** @description CreateImportInput */
|
|
3001
|
+
requestBody: {
|
|
3002
|
+
content: {
|
|
3003
|
+
'application/json': {
|
|
3004
|
+
/** @enum {string} */
|
|
3005
|
+
type: 'text';
|
|
3006
|
+
title: string;
|
|
3007
|
+
content: string;
|
|
3008
|
+
/**
|
|
3009
|
+
* @default text/markdown
|
|
3010
|
+
* @enum {string}
|
|
3011
|
+
*/
|
|
3012
|
+
contentType?: 'text/markdown' | 'text/plain';
|
|
3013
|
+
} | {
|
|
3014
|
+
/** Format: uri */
|
|
3015
|
+
url: string;
|
|
3016
|
+
/** @description CrawlOptions */
|
|
3017
|
+
options?: {
|
|
3018
|
+
includePaths?: string[];
|
|
3019
|
+
excludePaths?: string[];
|
|
3020
|
+
maxDepth?: number;
|
|
3021
|
+
sitemapOnly?: boolean;
|
|
3022
|
+
ignoreQueryParameters?: boolean;
|
|
3023
|
+
pageLimit?: number;
|
|
3024
|
+
};
|
|
3025
|
+
/** @enum {string} */
|
|
3026
|
+
type: 'crawl';
|
|
3027
|
+
} | {
|
|
3028
|
+
sanityProjectId: string;
|
|
3029
|
+
sanityDatasetId: string;
|
|
3030
|
+
query: string;
|
|
3031
|
+
/** @enum {string} */
|
|
3032
|
+
type: 'dataset';
|
|
3033
|
+
};
|
|
3034
|
+
};
|
|
3035
|
+
};
|
|
3036
|
+
responses: {
|
|
3037
|
+
/** @description JobAccepted */
|
|
3038
|
+
202: {
|
|
3039
|
+
headers: {
|
|
3040
|
+
[name: string]: unknown;
|
|
3041
|
+
};
|
|
3042
|
+
content: {
|
|
3043
|
+
'application/json': {
|
|
3044
|
+
jobId: string;
|
|
3045
|
+
};
|
|
3046
|
+
};
|
|
3047
|
+
};
|
|
3048
|
+
};
|
|
3049
|
+
};
|
|
3050
|
+
startUpload: {
|
|
3051
|
+
parameters: {
|
|
3052
|
+
query?: never;
|
|
3053
|
+
header?: never;
|
|
3054
|
+
path: {
|
|
3055
|
+
knowledgeBaseId: string;
|
|
3056
|
+
};
|
|
3057
|
+
cookie?: never;
|
|
3058
|
+
};
|
|
3059
|
+
requestBody: {
|
|
3060
|
+
content: {
|
|
3061
|
+
'application/json': {
|
|
3062
|
+
filename: string;
|
|
3063
|
+
contentType?: string;
|
|
3064
|
+
};
|
|
3065
|
+
};
|
|
3066
|
+
};
|
|
3067
|
+
responses: {
|
|
3068
|
+
/** @description Default Response */
|
|
3069
|
+
201: {
|
|
3070
|
+
headers: {
|
|
3071
|
+
[name: string]: unknown;
|
|
3072
|
+
};
|
|
3073
|
+
content: {
|
|
3074
|
+
'application/json': {
|
|
3075
|
+
/** Format: uuid */
|
|
3076
|
+
importId: string;
|
|
3077
|
+
/** Format: uri */
|
|
3078
|
+
uploadUrl: string;
|
|
3079
|
+
};
|
|
3080
|
+
};
|
|
3081
|
+
};
|
|
3082
|
+
};
|
|
3083
|
+
};
|
|
3084
|
+
completeUpload: {
|
|
3085
|
+
parameters: {
|
|
3086
|
+
query?: never;
|
|
3087
|
+
header?: never;
|
|
3088
|
+
path: {
|
|
3089
|
+
knowledgeBaseId: string;
|
|
3090
|
+
importId: string;
|
|
3091
|
+
};
|
|
3092
|
+
cookie?: never;
|
|
3093
|
+
};
|
|
3094
|
+
requestBody?: never;
|
|
3095
|
+
responses: {
|
|
3096
|
+
/** @description JobAccepted */
|
|
3097
|
+
202: {
|
|
3098
|
+
headers: {
|
|
3099
|
+
[name: string]: unknown;
|
|
3100
|
+
};
|
|
3101
|
+
content: {
|
|
3102
|
+
'application/json': {
|
|
3103
|
+
jobId: string;
|
|
3104
|
+
};
|
|
3105
|
+
};
|
|
3106
|
+
};
|
|
3107
|
+
};
|
|
3108
|
+
};
|
|
3109
|
+
getImport: {
|
|
3110
|
+
parameters: {
|
|
3111
|
+
query?: never;
|
|
3112
|
+
header?: never;
|
|
3113
|
+
path: {
|
|
3114
|
+
knowledgeBaseId: string;
|
|
3115
|
+
importId: string;
|
|
3116
|
+
};
|
|
3117
|
+
cookie?: never;
|
|
3118
|
+
};
|
|
3119
|
+
requestBody?: never;
|
|
3120
|
+
responses: {
|
|
3121
|
+
/** @description Import */
|
|
3122
|
+
200: {
|
|
3123
|
+
headers: {
|
|
3124
|
+
[name: string]: unknown;
|
|
3125
|
+
};
|
|
3126
|
+
content: {
|
|
3127
|
+
'application/json': {
|
|
3128
|
+
/** Format: uuid */
|
|
3129
|
+
id: string;
|
|
3130
|
+
/** Format: uuid */
|
|
3131
|
+
knowledgeBaseId: string;
|
|
3132
|
+
name: string | null;
|
|
3133
|
+
sizeBytes: number | null;
|
|
3134
|
+
/** @enum {string} */
|
|
3135
|
+
status: 'uploading' | 'processing' | 'complete' | 'failed';
|
|
3136
|
+
/** @enum {string} */
|
|
3137
|
+
sourceKind: 'web' | 'file' | 'dataset';
|
|
3138
|
+
/** Format: date-time */
|
|
3139
|
+
lastCheckedAt: string | null;
|
|
3140
|
+
sourceCount: number;
|
|
3141
|
+
totalDistillableCount: number;
|
|
3142
|
+
distilledCount: number;
|
|
3143
|
+
unsupportedCount: number;
|
|
3144
|
+
statusDetail: string | null;
|
|
3145
|
+
error: string | null;
|
|
3146
|
+
/** @description CrawlOptions */
|
|
3147
|
+
crawlOptions: {
|
|
3148
|
+
includePaths?: string[];
|
|
3149
|
+
excludePaths?: string[];
|
|
3150
|
+
maxDepth?: number;
|
|
3151
|
+
sitemapOnly?: boolean;
|
|
3152
|
+
ignoreQueryParameters?: boolean;
|
|
3153
|
+
pageLimit?: number;
|
|
3154
|
+
} | null;
|
|
3155
|
+
/** @description DatasetSourceBinding */
|
|
3156
|
+
datasetSource: {
|
|
3157
|
+
sanityProjectId: string;
|
|
3158
|
+
sanityDatasetId: string;
|
|
3159
|
+
query: string;
|
|
3160
|
+
} | null;
|
|
3161
|
+
/** @description Actor */
|
|
3162
|
+
createdBy: {
|
|
3163
|
+
id: string | null;
|
|
3164
|
+
displayName: string | null;
|
|
3165
|
+
} | null;
|
|
3166
|
+
/** Format: date-time */
|
|
3167
|
+
createdAt: string;
|
|
3168
|
+
/** Format: date-time */
|
|
3169
|
+
completedAt: string | null;
|
|
3170
|
+
};
|
|
3171
|
+
};
|
|
3172
|
+
};
|
|
3173
|
+
};
|
|
3174
|
+
};
|
|
3175
|
+
deleteImport: {
|
|
3176
|
+
parameters: {
|
|
3177
|
+
query?: never;
|
|
3178
|
+
header?: never;
|
|
3179
|
+
path: {
|
|
3180
|
+
knowledgeBaseId: string;
|
|
3181
|
+
importId: string;
|
|
3182
|
+
};
|
|
3183
|
+
cookie?: never;
|
|
3184
|
+
};
|
|
3185
|
+
requestBody?: never;
|
|
3186
|
+
responses: {
|
|
3187
|
+
/** @description Default Response */
|
|
3188
|
+
204: {
|
|
3189
|
+
headers: {
|
|
3190
|
+
[name: string]: unknown;
|
|
3191
|
+
};
|
|
3192
|
+
content: {
|
|
3193
|
+
'application/json': null;
|
|
3194
|
+
};
|
|
3195
|
+
};
|
|
3196
|
+
};
|
|
3197
|
+
};
|
|
3198
|
+
downloadImport: {
|
|
3199
|
+
parameters: {
|
|
3200
|
+
query?: never;
|
|
3201
|
+
header?: never;
|
|
3202
|
+
path: {
|
|
3203
|
+
knowledgeBaseId: string;
|
|
3204
|
+
importId: string;
|
|
3205
|
+
};
|
|
3206
|
+
cookie?: never;
|
|
3207
|
+
};
|
|
3208
|
+
requestBody?: never;
|
|
3209
|
+
responses: {
|
|
3210
|
+
/** @description Default Response */
|
|
3211
|
+
200: {
|
|
3212
|
+
headers: {
|
|
3213
|
+
[name: string]: unknown;
|
|
3214
|
+
};
|
|
3215
|
+
content: {
|
|
3216
|
+
'application/json': {
|
|
3217
|
+
/** Format: uri */
|
|
3218
|
+
url: string;
|
|
3219
|
+
/** Format: date-time */
|
|
3220
|
+
expiresAt: string;
|
|
3221
|
+
};
|
|
3222
|
+
};
|
|
3223
|
+
};
|
|
3224
|
+
};
|
|
3225
|
+
};
|
|
3226
|
+
createInstruction: {
|
|
3227
|
+
parameters: {
|
|
3228
|
+
query?: never;
|
|
3229
|
+
header?: never;
|
|
3230
|
+
path: {
|
|
3231
|
+
knowledgeBaseId: string;
|
|
3232
|
+
};
|
|
3233
|
+
cookie?: never;
|
|
3234
|
+
};
|
|
3235
|
+
/** @description CreateInstructionInput */
|
|
3236
|
+
requestBody: {
|
|
3237
|
+
content: {
|
|
3238
|
+
'application/json': {
|
|
3239
|
+
statement: string;
|
|
3240
|
+
scopeSourceIds?: string[] | null;
|
|
3241
|
+
rebuildPaths?: string[];
|
|
3242
|
+
verified?: boolean;
|
|
3243
|
+
};
|
|
3244
|
+
};
|
|
3245
|
+
};
|
|
3246
|
+
responses: {
|
|
3247
|
+
/** @description CreateInstructionResponse */
|
|
3248
|
+
201: {
|
|
3249
|
+
headers: {
|
|
3250
|
+
[name: string]: unknown;
|
|
3251
|
+
};
|
|
3252
|
+
content: {
|
|
3253
|
+
'application/json': {
|
|
3254
|
+
/** @description Instruction */
|
|
3255
|
+
instruction: {
|
|
3256
|
+
id: string;
|
|
3257
|
+
knowledgeBaseId: string;
|
|
3258
|
+
/** @enum {string} */
|
|
3259
|
+
origin: 'conflict' | 'human';
|
|
3260
|
+
/** @enum {string} */
|
|
3261
|
+
status: 'active' | 'archived';
|
|
3262
|
+
statement: string;
|
|
3263
|
+
scopeSourceIds: string[] | null;
|
|
3264
|
+
/** Format: date-time */
|
|
3265
|
+
archivedAt: string | null;
|
|
3266
|
+
archivedReason: string | null;
|
|
3267
|
+
sourceIssueId: string | null;
|
|
3268
|
+
/** @description Actor */
|
|
3269
|
+
createdBy: {
|
|
3270
|
+
id: string | null;
|
|
3271
|
+
displayName: string | null;
|
|
3272
|
+
} | null;
|
|
3273
|
+
/** @description Actor */
|
|
3274
|
+
updatedBy: {
|
|
3275
|
+
id: string | null;
|
|
3276
|
+
displayName: string | null;
|
|
3277
|
+
} | null;
|
|
3278
|
+
/** Format: date-time */
|
|
3279
|
+
createdAt: string;
|
|
3280
|
+
/** Format: date-time */
|
|
3281
|
+
updatedAt: string | null;
|
|
3282
|
+
};
|
|
3283
|
+
rebuildJobId: string | null;
|
|
3284
|
+
};
|
|
3285
|
+
};
|
|
3286
|
+
};
|
|
3287
|
+
};
|
|
3288
|
+
};
|
|
3289
|
+
deleteInstruction: {
|
|
3290
|
+
parameters: {
|
|
3291
|
+
query?: never;
|
|
3292
|
+
header?: never;
|
|
3293
|
+
path: {
|
|
3294
|
+
knowledgeBaseId: string;
|
|
3295
|
+
instructionId: string;
|
|
3296
|
+
};
|
|
3297
|
+
cookie?: never;
|
|
3298
|
+
};
|
|
3299
|
+
requestBody?: never;
|
|
3300
|
+
responses: {
|
|
3301
|
+
/** @description Default Response */
|
|
3302
|
+
204: {
|
|
3303
|
+
headers: {
|
|
3304
|
+
[name: string]: unknown;
|
|
3305
|
+
};
|
|
3306
|
+
content: {
|
|
3307
|
+
'application/json': null;
|
|
3308
|
+
};
|
|
3309
|
+
};
|
|
3310
|
+
};
|
|
3311
|
+
};
|
|
3312
|
+
updateInstruction: {
|
|
3313
|
+
parameters: {
|
|
3314
|
+
query?: never;
|
|
3315
|
+
header?: never;
|
|
3316
|
+
path: {
|
|
3317
|
+
knowledgeBaseId: string;
|
|
3318
|
+
instructionId: string;
|
|
3319
|
+
};
|
|
3320
|
+
cookie?: never;
|
|
3321
|
+
};
|
|
3322
|
+
/** @description UpdateInstructionInput */
|
|
3323
|
+
requestBody: {
|
|
3324
|
+
content: {
|
|
3325
|
+
'application/json': {
|
|
3326
|
+
statement?: string;
|
|
3327
|
+
scopeSourceIds?: string[] | null;
|
|
3328
|
+
};
|
|
3329
|
+
};
|
|
3330
|
+
};
|
|
3331
|
+
responses: {
|
|
3332
|
+
/** @description Instruction */
|
|
3333
|
+
200: {
|
|
3334
|
+
headers: {
|
|
3335
|
+
[name: string]: unknown;
|
|
3336
|
+
};
|
|
3337
|
+
content: {
|
|
3338
|
+
'application/json': {
|
|
3339
|
+
id: string;
|
|
3340
|
+
knowledgeBaseId: string;
|
|
3341
|
+
/** @enum {string} */
|
|
3342
|
+
origin: 'conflict' | 'human';
|
|
3343
|
+
/** @enum {string} */
|
|
3344
|
+
status: 'active' | 'archived';
|
|
3345
|
+
statement: string;
|
|
3346
|
+
scopeSourceIds: string[] | null;
|
|
3347
|
+
/** Format: date-time */
|
|
3348
|
+
archivedAt: string | null;
|
|
3349
|
+
archivedReason: string | null;
|
|
3350
|
+
sourceIssueId: string | null;
|
|
3351
|
+
/** @description Actor */
|
|
3352
|
+
createdBy: {
|
|
3353
|
+
id: string | null;
|
|
3354
|
+
displayName: string | null;
|
|
3355
|
+
} | null;
|
|
3356
|
+
/** @description Actor */
|
|
3357
|
+
updatedBy: {
|
|
3358
|
+
id: string | null;
|
|
3359
|
+
displayName: string | null;
|
|
3360
|
+
} | null;
|
|
3361
|
+
/** Format: date-time */
|
|
3362
|
+
createdAt: string;
|
|
3363
|
+
/** Format: date-time */
|
|
3364
|
+
updatedAt: string | null;
|
|
3365
|
+
};
|
|
3366
|
+
};
|
|
3367
|
+
};
|
|
3368
|
+
};
|
|
3369
|
+
};
|
|
3370
|
+
applyIssues: {
|
|
3371
|
+
parameters: {
|
|
3372
|
+
query?: never;
|
|
3373
|
+
header?: never;
|
|
3374
|
+
path: {
|
|
3375
|
+
knowledgeBaseId: string;
|
|
3376
|
+
};
|
|
3377
|
+
cookie?: never;
|
|
3378
|
+
};
|
|
3379
|
+
requestBody: {
|
|
3380
|
+
content: {
|
|
3381
|
+
'application/json': {
|
|
3382
|
+
issueIds: string[];
|
|
3383
|
+
};
|
|
3384
|
+
};
|
|
3385
|
+
};
|
|
3386
|
+
responses: {
|
|
3387
|
+
/** @description JobAccepted */
|
|
3388
|
+
202: {
|
|
3389
|
+
headers: {
|
|
3390
|
+
[name: string]: unknown;
|
|
3391
|
+
};
|
|
3392
|
+
content: {
|
|
3393
|
+
'application/json': {
|
|
3394
|
+
jobId: string;
|
|
3395
|
+
};
|
|
3396
|
+
};
|
|
3397
|
+
};
|
|
3398
|
+
};
|
|
3399
|
+
};
|
|
3400
|
+
dismissIssue: {
|
|
3401
|
+
parameters: {
|
|
3402
|
+
query?: never;
|
|
3403
|
+
header?: never;
|
|
3404
|
+
path: {
|
|
3405
|
+
knowledgeBaseId: string;
|
|
3406
|
+
issueId: string;
|
|
3407
|
+
};
|
|
3408
|
+
cookie?: never;
|
|
3409
|
+
};
|
|
3410
|
+
requestBody?: never;
|
|
3411
|
+
responses: {
|
|
3412
|
+
/** @description Issue */
|
|
3413
|
+
200: {
|
|
3414
|
+
headers: {
|
|
3415
|
+
[name: string]: unknown;
|
|
3416
|
+
};
|
|
3417
|
+
content: {
|
|
3418
|
+
'application/json': {
|
|
3419
|
+
id: string;
|
|
3420
|
+
knowledgeBaseId: string;
|
|
3421
|
+
/** @description IssueContent */
|
|
3422
|
+
content: {
|
|
3423
|
+
/** @enum {string} */
|
|
3424
|
+
kind: 'conflict' | 'gap' | 'update_required' | 'add_entry' | 'remove_entry' | 'split_entry' | 'merge_entry';
|
|
3425
|
+
/** @enum {string} */
|
|
3426
|
+
severity: 'critical' | 'suggestion';
|
|
3427
|
+
scopePath: string;
|
|
3428
|
+
issue: string;
|
|
3429
|
+
suggestedFix: string;
|
|
3430
|
+
citedSourceIds?: string[];
|
|
3431
|
+
claimKey?: string;
|
|
3432
|
+
involvedScopes?: string[];
|
|
3433
|
+
currentClaim?: string;
|
|
3434
|
+
alternativeClaim?: string;
|
|
3435
|
+
/** @enum {string} */
|
|
3436
|
+
currentAuthority?: 'primary' | 'secondary' | 'community';
|
|
3437
|
+
/** @enum {string} */
|
|
3438
|
+
alternativeAuthority?: 'primary' | 'secondary' | 'community';
|
|
3439
|
+
/** @enum {string} */
|
|
3440
|
+
suggestedResolution?: 'keep_existing' | 'accept_new';
|
|
3441
|
+
};
|
|
3442
|
+
/** @enum {string} */
|
|
3443
|
+
status: 'open' | 'accepted' | 'rejected';
|
|
3444
|
+
/** @enum {string|null} */
|
|
3445
|
+
resolution: 'keep_existing' | 'accept_new' | null;
|
|
3446
|
+
/** @description IssueResolvedBy */
|
|
3447
|
+
resolvedBy: {
|
|
3448
|
+
id: string;
|
|
3449
|
+
/** @enum {string} */
|
|
3450
|
+
kind: 'user' | 'robot';
|
|
3451
|
+
} | null;
|
|
3452
|
+
/** Format: date-time */
|
|
3453
|
+
createdAt: string;
|
|
3454
|
+
/** Format: date-time */
|
|
3455
|
+
resolvedAt: string | null;
|
|
3456
|
+
};
|
|
3457
|
+
};
|
|
3458
|
+
};
|
|
3459
|
+
};
|
|
3460
|
+
};
|
|
3461
|
+
reopenIssue: {
|
|
3462
|
+
parameters: {
|
|
3463
|
+
query?: never;
|
|
3464
|
+
header?: never;
|
|
3465
|
+
path: {
|
|
3466
|
+
knowledgeBaseId: string;
|
|
3467
|
+
issueId: string;
|
|
3468
|
+
};
|
|
3469
|
+
cookie?: never;
|
|
3470
|
+
};
|
|
3471
|
+
requestBody?: never;
|
|
3472
|
+
responses: {
|
|
3473
|
+
/** @description Issue */
|
|
3474
|
+
200: {
|
|
3475
|
+
headers: {
|
|
3476
|
+
[name: string]: unknown;
|
|
3477
|
+
};
|
|
3478
|
+
content: {
|
|
3479
|
+
'application/json': {
|
|
3480
|
+
id: string;
|
|
3481
|
+
knowledgeBaseId: string;
|
|
3482
|
+
/** @description IssueContent */
|
|
3483
|
+
content: {
|
|
3484
|
+
/** @enum {string} */
|
|
3485
|
+
kind: 'conflict' | 'gap' | 'update_required' | 'add_entry' | 'remove_entry' | 'split_entry' | 'merge_entry';
|
|
3486
|
+
/** @enum {string} */
|
|
3487
|
+
severity: 'critical' | 'suggestion';
|
|
3488
|
+
scopePath: string;
|
|
3489
|
+
issue: string;
|
|
3490
|
+
suggestedFix: string;
|
|
3491
|
+
citedSourceIds?: string[];
|
|
3492
|
+
claimKey?: string;
|
|
3493
|
+
involvedScopes?: string[];
|
|
3494
|
+
currentClaim?: string;
|
|
3495
|
+
alternativeClaim?: string;
|
|
3496
|
+
/** @enum {string} */
|
|
3497
|
+
currentAuthority?: 'primary' | 'secondary' | 'community';
|
|
3498
|
+
/** @enum {string} */
|
|
3499
|
+
alternativeAuthority?: 'primary' | 'secondary' | 'community';
|
|
3500
|
+
/** @enum {string} */
|
|
3501
|
+
suggestedResolution?: 'keep_existing' | 'accept_new';
|
|
3502
|
+
};
|
|
3503
|
+
/** @enum {string} */
|
|
3504
|
+
status: 'open' | 'accepted' | 'rejected';
|
|
3505
|
+
/** @enum {string|null} */
|
|
3506
|
+
resolution: 'keep_existing' | 'accept_new' | null;
|
|
3507
|
+
/** @description IssueResolvedBy */
|
|
3508
|
+
resolvedBy: {
|
|
3509
|
+
id: string;
|
|
3510
|
+
/** @enum {string} */
|
|
3511
|
+
kind: 'user' | 'robot';
|
|
3512
|
+
} | null;
|
|
3513
|
+
/** Format: date-time */
|
|
3514
|
+
createdAt: string;
|
|
3515
|
+
/** Format: date-time */
|
|
3516
|
+
resolvedAt: string | null;
|
|
3517
|
+
};
|
|
3518
|
+
};
|
|
3519
|
+
};
|
|
3520
|
+
};
|
|
3521
|
+
};
|
|
3522
|
+
resolveIssue: {
|
|
3523
|
+
parameters: {
|
|
3524
|
+
query?: never;
|
|
3525
|
+
header?: never;
|
|
3526
|
+
path: {
|
|
3527
|
+
knowledgeBaseId: string;
|
|
3528
|
+
issueId: string;
|
|
3529
|
+
};
|
|
3530
|
+
cookie?: never;
|
|
3531
|
+
};
|
|
3532
|
+
requestBody: {
|
|
3533
|
+
content: {
|
|
3534
|
+
'application/json': {
|
|
3535
|
+
/** @enum {string} */
|
|
3536
|
+
resolution: 'keep_existing' | 'accept_new';
|
|
3537
|
+
};
|
|
3538
|
+
};
|
|
3539
|
+
};
|
|
3540
|
+
responses: {
|
|
3541
|
+
/** @description ResolveIssueResponse */
|
|
3542
|
+
200: {
|
|
3543
|
+
headers: {
|
|
3544
|
+
[name: string]: unknown;
|
|
3545
|
+
};
|
|
3546
|
+
content: {
|
|
3547
|
+
'application/json': {
|
|
3548
|
+
/** @description Issue */
|
|
3549
|
+
issue: {
|
|
3550
|
+
id: string;
|
|
3551
|
+
knowledgeBaseId: string;
|
|
3552
|
+
/** @description IssueContent */
|
|
3553
|
+
content: {
|
|
3554
|
+
/** @enum {string} */
|
|
3555
|
+
kind: 'conflict' | 'gap' | 'update_required' | 'add_entry' | 'remove_entry' | 'split_entry' | 'merge_entry';
|
|
3556
|
+
/** @enum {string} */
|
|
3557
|
+
severity: 'critical' | 'suggestion';
|
|
3558
|
+
scopePath: string;
|
|
3559
|
+
issue: string;
|
|
3560
|
+
suggestedFix: string;
|
|
3561
|
+
citedSourceIds?: string[];
|
|
3562
|
+
claimKey?: string;
|
|
3563
|
+
involvedScopes?: string[];
|
|
3564
|
+
currentClaim?: string;
|
|
3565
|
+
alternativeClaim?: string;
|
|
3566
|
+
/** @enum {string} */
|
|
3567
|
+
currentAuthority?: 'primary' | 'secondary' | 'community';
|
|
3568
|
+
/** @enum {string} */
|
|
3569
|
+
alternativeAuthority?: 'primary' | 'secondary' | 'community';
|
|
3570
|
+
/** @enum {string} */
|
|
3571
|
+
suggestedResolution?: 'keep_existing' | 'accept_new';
|
|
3572
|
+
};
|
|
3573
|
+
/** @enum {string} */
|
|
3574
|
+
status: 'open' | 'accepted' | 'rejected';
|
|
3575
|
+
/** @enum {string|null} */
|
|
3576
|
+
resolution: 'keep_existing' | 'accept_new' | null;
|
|
3577
|
+
/** @description IssueResolvedBy */
|
|
3578
|
+
resolvedBy: {
|
|
3579
|
+
id: string;
|
|
3580
|
+
/** @enum {string} */
|
|
3581
|
+
kind: 'user' | 'robot';
|
|
3582
|
+
} | null;
|
|
3583
|
+
/** Format: date-time */
|
|
3584
|
+
createdAt: string;
|
|
3585
|
+
/** Format: date-time */
|
|
3586
|
+
resolvedAt: string | null;
|
|
3587
|
+
};
|
|
3588
|
+
jobId: string | null;
|
|
3589
|
+
};
|
|
3590
|
+
};
|
|
3591
|
+
};
|
|
3592
|
+
};
|
|
3593
|
+
};
|
|
3594
|
+
getJob: {
|
|
3595
|
+
parameters: {
|
|
3596
|
+
query?: never;
|
|
3597
|
+
header?: never;
|
|
3598
|
+
path: {
|
|
3599
|
+
knowledgeBaseId: string;
|
|
3600
|
+
jobId: string;
|
|
3601
|
+
};
|
|
3602
|
+
cookie?: never;
|
|
3603
|
+
};
|
|
3604
|
+
requestBody?: never;
|
|
3605
|
+
responses: {
|
|
3606
|
+
/** @description Job */
|
|
3607
|
+
200: {
|
|
3608
|
+
headers: {
|
|
3609
|
+
[name: string]: unknown;
|
|
3610
|
+
};
|
|
3611
|
+
content: {
|
|
3612
|
+
'application/json': {
|
|
3613
|
+
id: string;
|
|
3614
|
+
/** @enum {string} */
|
|
3615
|
+
status: 'pending' | 'queued' | 'running' | 'succeeded' | 'failed' | 'cancelled';
|
|
3616
|
+
/** Format: date-time */
|
|
3617
|
+
startedAt: string | null;
|
|
3618
|
+
/** Format: date-time */
|
|
3619
|
+
completedAt: string | null;
|
|
3620
|
+
result?: unknown;
|
|
3621
|
+
error?: string | null;
|
|
3622
|
+
};
|
|
3623
|
+
};
|
|
3624
|
+
};
|
|
3625
|
+
};
|
|
3626
|
+
};
|
|
3627
|
+
refreshKnowledgeBase: {
|
|
3628
|
+
parameters: {
|
|
3629
|
+
query?: never;
|
|
3630
|
+
header?: never;
|
|
3631
|
+
path: {
|
|
3632
|
+
knowledgeBaseId: string;
|
|
3633
|
+
};
|
|
3634
|
+
cookie?: never;
|
|
3635
|
+
};
|
|
3636
|
+
requestBody?: never;
|
|
3637
|
+
responses: {
|
|
3638
|
+
/** @description RefreshAccepted */
|
|
3639
|
+
202: {
|
|
3640
|
+
headers: {
|
|
3641
|
+
[name: string]: unknown;
|
|
3642
|
+
};
|
|
3643
|
+
content: {
|
|
3644
|
+
'application/json': {
|
|
3645
|
+
jobId: string;
|
|
3646
|
+
started: boolean;
|
|
3647
|
+
};
|
|
3648
|
+
};
|
|
3649
|
+
};
|
|
3650
|
+
};
|
|
3651
|
+
};
|
|
3652
|
+
listSources: {
|
|
3653
|
+
parameters: {
|
|
3654
|
+
query?: {
|
|
3655
|
+
cursor?: string;
|
|
3656
|
+
limit?: number;
|
|
3657
|
+
status?: 'pending' | 'processing' | 'ready' | 'failed' | 'skipped';
|
|
3658
|
+
importId?: string;
|
|
3659
|
+
ids?: string;
|
|
3660
|
+
};
|
|
3661
|
+
header?: never;
|
|
3662
|
+
path: {
|
|
3663
|
+
knowledgeBaseId: string;
|
|
3664
|
+
};
|
|
3665
|
+
cookie?: never;
|
|
3666
|
+
};
|
|
3667
|
+
requestBody?: never;
|
|
3668
|
+
responses: {
|
|
3669
|
+
/** @description Default Response */
|
|
3670
|
+
200: {
|
|
3671
|
+
headers: {
|
|
3672
|
+
[name: string]: unknown;
|
|
3673
|
+
};
|
|
3674
|
+
content: {
|
|
3675
|
+
'application/json': {
|
|
3676
|
+
data: {
|
|
3677
|
+
/** Format: uuid */
|
|
3678
|
+
id: string;
|
|
3679
|
+
/** Format: uuid */
|
|
3680
|
+
knowledgeBaseId: string;
|
|
3681
|
+
filename: string;
|
|
3682
|
+
/** @enum {string} */
|
|
3683
|
+
kind: 'web' | 'file' | 'dataset';
|
|
3684
|
+
sizeBytes: number;
|
|
3685
|
+
/** @enum {string} */
|
|
3686
|
+
status: 'pending' | 'processing' | 'ready' | 'failed' | 'skipped';
|
|
3687
|
+
tldr: string | null;
|
|
3688
|
+
topics: string[] | null;
|
|
3689
|
+
canonicalUrl: string | null;
|
|
3690
|
+
/** Format: date-time */
|
|
3691
|
+
fetchedAt: string | null;
|
|
3692
|
+
/** Format: date-time */
|
|
3693
|
+
distilledAt: string | null;
|
|
3694
|
+
/** Format: date-time */
|
|
3695
|
+
createdAt: string;
|
|
3696
|
+
}[];
|
|
3697
|
+
nextCursor: string | null;
|
|
3698
|
+
};
|
|
3699
|
+
};
|
|
3700
|
+
};
|
|
3701
|
+
};
|
|
3702
|
+
};
|
|
3703
|
+
getSource: {
|
|
3704
|
+
parameters: {
|
|
3705
|
+
query?: never;
|
|
3706
|
+
header?: never;
|
|
3707
|
+
path: {
|
|
3708
|
+
knowledgeBaseId: string;
|
|
3709
|
+
sourceId: string;
|
|
3710
|
+
};
|
|
3711
|
+
cookie?: never;
|
|
3712
|
+
};
|
|
3713
|
+
requestBody?: never;
|
|
3714
|
+
responses: {
|
|
3715
|
+
/** @description Source */
|
|
3716
|
+
200: {
|
|
3717
|
+
headers: {
|
|
3718
|
+
[name: string]: unknown;
|
|
3719
|
+
};
|
|
3720
|
+
content: {
|
|
3721
|
+
'application/json': {
|
|
3722
|
+
/** Format: uuid */
|
|
3723
|
+
id: string;
|
|
3724
|
+
/** Format: uuid */
|
|
3725
|
+
knowledgeBaseId: string;
|
|
3726
|
+
filename: string;
|
|
3727
|
+
/** @enum {string} */
|
|
3728
|
+
kind: 'web' | 'file' | 'dataset';
|
|
3729
|
+
sizeBytes: number;
|
|
3730
|
+
/** @enum {string} */
|
|
3731
|
+
status: 'pending' | 'processing' | 'ready' | 'failed' | 'skipped';
|
|
3732
|
+
tldr: string | null;
|
|
3733
|
+
topics: string[] | null;
|
|
3734
|
+
canonicalUrl: string | null;
|
|
3735
|
+
/** Format: date-time */
|
|
3736
|
+
fetchedAt: string | null;
|
|
3737
|
+
/** Format: date-time */
|
|
3738
|
+
distilledAt: string | null;
|
|
3739
|
+
/** Format: date-time */
|
|
3740
|
+
createdAt: string;
|
|
3741
|
+
};
|
|
3742
|
+
};
|
|
3743
|
+
};
|
|
3744
|
+
};
|
|
3745
|
+
};
|
|
3746
|
+
deleteSource: {
|
|
3747
|
+
parameters: {
|
|
3748
|
+
query?: never;
|
|
3749
|
+
header?: never;
|
|
3750
|
+
path: {
|
|
3751
|
+
knowledgeBaseId: string;
|
|
3752
|
+
sourceId: string;
|
|
3753
|
+
};
|
|
3754
|
+
cookie?: never;
|
|
3755
|
+
};
|
|
3756
|
+
requestBody?: never;
|
|
3757
|
+
responses: {
|
|
3758
|
+
/** @description Default Response */
|
|
3759
|
+
204: {
|
|
3760
|
+
headers: {
|
|
3761
|
+
[name: string]: unknown;
|
|
3762
|
+
};
|
|
3763
|
+
content: {
|
|
3764
|
+
'application/json': null;
|
|
3765
|
+
};
|
|
3766
|
+
};
|
|
3767
|
+
};
|
|
3768
|
+
};
|
|
3769
|
+
getSourceContent: {
|
|
3770
|
+
parameters: {
|
|
3771
|
+
query?: {
|
|
3772
|
+
/** @description Output representation. `json` (default) returns the structured resource; `markdown` / `plain` return the rendered, LLM-ready text. */
|
|
3773
|
+
format?: 'json' | 'markdown' | 'plain';
|
|
3774
|
+
startLine?: number;
|
|
3775
|
+
endLine?: number;
|
|
3776
|
+
};
|
|
3777
|
+
header?: never;
|
|
3778
|
+
path: {
|
|
3779
|
+
knowledgeBaseId: string;
|
|
3780
|
+
sourceId: string;
|
|
3781
|
+
};
|
|
3782
|
+
cookie?: never;
|
|
3783
|
+
};
|
|
3784
|
+
requestBody?: never;
|
|
3785
|
+
responses: {
|
|
3786
|
+
/** @description SourceContent */
|
|
3787
|
+
200: {
|
|
3788
|
+
headers: {
|
|
3789
|
+
[name: string]: unknown;
|
|
3790
|
+
};
|
|
3791
|
+
content: {
|
|
3792
|
+
'application/json': {
|
|
3793
|
+
/** Format: uuid */
|
|
3794
|
+
sourceId: string;
|
|
3795
|
+
content: string;
|
|
3796
|
+
totalLines: number;
|
|
3797
|
+
slice: {
|
|
3798
|
+
start: number;
|
|
3799
|
+
end: number;
|
|
3800
|
+
};
|
|
3801
|
+
};
|
|
3802
|
+
'text/markdown': string;
|
|
3803
|
+
'text/plain': string;
|
|
3804
|
+
};
|
|
3805
|
+
};
|
|
3806
|
+
};
|
|
3807
|
+
};
|
|
3808
|
+
saveConversation: {
|
|
3809
|
+
parameters: {
|
|
3810
|
+
query?: never;
|
|
3811
|
+
header?: never;
|
|
3812
|
+
path: {
|
|
3813
|
+
threadId: string;
|
|
3814
|
+
};
|
|
3815
|
+
cookie?: never;
|
|
3816
|
+
};
|
|
3817
|
+
/** @description SaveConversationInput */
|
|
3818
|
+
requestBody: {
|
|
3819
|
+
content: {
|
|
3820
|
+
'application/json': {
|
|
3821
|
+
messages: {
|
|
3822
|
+
/** @enum {string} */
|
|
3823
|
+
role: 'user' | 'assistant' | 'system' | 'tool';
|
|
3824
|
+
/** @default null */
|
|
3825
|
+
content?: string | null;
|
|
3826
|
+
/** @default null */
|
|
3827
|
+
toolName?: string | null;
|
|
3828
|
+
/**
|
|
3829
|
+
* @default null
|
|
3830
|
+
* @enum {string|null}
|
|
3831
|
+
*/
|
|
3832
|
+
toolType?: 'call' | 'result' | null;
|
|
3833
|
+
}[];
|
|
3834
|
+
modelProvider?: string;
|
|
3835
|
+
modelId?: string;
|
|
3836
|
+
/** @description ConversationTokenUsage */
|
|
3837
|
+
tokenUsage?: {
|
|
3838
|
+
inputTokens?: number;
|
|
3839
|
+
outputTokens?: number;
|
|
3840
|
+
totalTokens?: number;
|
|
3841
|
+
};
|
|
3842
|
+
/** @description ConversationMetadata */
|
|
3843
|
+
metadata?: {
|
|
3844
|
+
[key: string]: string | string[];
|
|
3845
|
+
};
|
|
3846
|
+
};
|
|
3847
|
+
};
|
|
3848
|
+
};
|
|
3849
|
+
responses: {
|
|
3850
|
+
/** @description Conversation */
|
|
3851
|
+
200: {
|
|
3852
|
+
headers: {
|
|
3853
|
+
[name: string]: unknown;
|
|
3854
|
+
};
|
|
3855
|
+
content: {
|
|
3856
|
+
'application/json': {
|
|
3857
|
+
id: string;
|
|
3858
|
+
threadId: string;
|
|
3859
|
+
/** @description ConversationMetadata */
|
|
3860
|
+
metadata: {
|
|
3861
|
+
[key: string]: string | string[];
|
|
3862
|
+
} | null;
|
|
3863
|
+
/** Format: date-time */
|
|
3864
|
+
startedAt: string;
|
|
3865
|
+
/** Format: date-time */
|
|
3866
|
+
messagesUpdatedAt: string;
|
|
3867
|
+
messages: {
|
|
3868
|
+
/** @enum {string} */
|
|
3869
|
+
role: 'user' | 'assistant' | 'system' | 'tool';
|
|
3870
|
+
/** @default null */
|
|
3871
|
+
content: string | null;
|
|
3872
|
+
/** @default null */
|
|
3873
|
+
toolName: string | null;
|
|
3874
|
+
/**
|
|
3875
|
+
* @default null
|
|
3876
|
+
* @enum {string|null}
|
|
3877
|
+
*/
|
|
3878
|
+
toolType: 'call' | 'result' | null;
|
|
3879
|
+
}[];
|
|
3880
|
+
modelProvider: string | null;
|
|
3881
|
+
modelId: string | null;
|
|
3882
|
+
/** @description ConversationTokenUsage */
|
|
3883
|
+
tokenUsage: {
|
|
3884
|
+
inputTokens?: number;
|
|
3885
|
+
outputTokens?: number;
|
|
3886
|
+
totalTokens?: number;
|
|
3887
|
+
} | null;
|
|
3888
|
+
/** @description ConversationCoreMetrics */
|
|
3889
|
+
coreMetrics: {
|
|
3890
|
+
successScore?: number;
|
|
3891
|
+
/** @enum {string} */
|
|
3892
|
+
sentiment?: 'positive' | 'neutral' | 'negative';
|
|
3893
|
+
contentGaps?: string[];
|
|
3894
|
+
} | null;
|
|
3895
|
+
/** Format: date-time */
|
|
3896
|
+
classifiedAt: string | null;
|
|
3897
|
+
classificationError: string | null;
|
|
3898
|
+
/** Format: date-time */
|
|
3899
|
+
createdAt: string;
|
|
3900
|
+
/** Format: date-time */
|
|
3901
|
+
updatedAt: string;
|
|
3902
|
+
};
|
|
3903
|
+
};
|
|
3904
|
+
};
|
|
3905
|
+
};
|
|
3906
|
+
};
|
|
3907
|
+
classifyConversation: {
|
|
3908
|
+
parameters: {
|
|
3909
|
+
query?: never;
|
|
3910
|
+
header?: never;
|
|
3911
|
+
path: {
|
|
3912
|
+
threadId: string;
|
|
3913
|
+
};
|
|
3914
|
+
cookie?: never;
|
|
3915
|
+
};
|
|
3916
|
+
/** @description ClassifyConversationInput */
|
|
3917
|
+
requestBody: {
|
|
3918
|
+
content: {
|
|
3919
|
+
'application/json': {
|
|
3920
|
+
coreMetrics?: {
|
|
3921
|
+
successScore: number;
|
|
3922
|
+
/** @enum {string} */
|
|
3923
|
+
sentiment: 'positive' | 'neutral' | 'negative';
|
|
3924
|
+
contentGaps: string[];
|
|
3925
|
+
};
|
|
3926
|
+
classificationError?: string;
|
|
3927
|
+
};
|
|
3928
|
+
};
|
|
3929
|
+
};
|
|
3930
|
+
responses: {
|
|
3931
|
+
/** @description Conversation */
|
|
3932
|
+
200: {
|
|
3933
|
+
headers: {
|
|
3934
|
+
[name: string]: unknown;
|
|
3935
|
+
};
|
|
3936
|
+
content: {
|
|
3937
|
+
'application/json': {
|
|
3938
|
+
id: string;
|
|
3939
|
+
threadId: string;
|
|
3940
|
+
/** @description ConversationMetadata */
|
|
3941
|
+
metadata: {
|
|
3942
|
+
[key: string]: string | string[];
|
|
3943
|
+
} | null;
|
|
3944
|
+
/** Format: date-time */
|
|
3945
|
+
startedAt: string;
|
|
3946
|
+
/** Format: date-time */
|
|
3947
|
+
messagesUpdatedAt: string;
|
|
3948
|
+
messages: {
|
|
3949
|
+
/** @enum {string} */
|
|
3950
|
+
role: 'user' | 'assistant' | 'system' | 'tool';
|
|
3951
|
+
/** @default null */
|
|
3952
|
+
content: string | null;
|
|
3953
|
+
/** @default null */
|
|
3954
|
+
toolName: string | null;
|
|
3955
|
+
/**
|
|
3956
|
+
* @default null
|
|
3957
|
+
* @enum {string|null}
|
|
3958
|
+
*/
|
|
3959
|
+
toolType: 'call' | 'result' | null;
|
|
3960
|
+
}[];
|
|
3961
|
+
modelProvider: string | null;
|
|
3962
|
+
modelId: string | null;
|
|
3963
|
+
/** @description ConversationTokenUsage */
|
|
3964
|
+
tokenUsage: {
|
|
3965
|
+
inputTokens?: number;
|
|
3966
|
+
outputTokens?: number;
|
|
3967
|
+
totalTokens?: number;
|
|
3968
|
+
} | null;
|
|
3969
|
+
/** @description ConversationCoreMetrics */
|
|
3970
|
+
coreMetrics: {
|
|
3971
|
+
successScore?: number;
|
|
3972
|
+
/** @enum {string} */
|
|
3973
|
+
sentiment?: 'positive' | 'neutral' | 'negative';
|
|
3974
|
+
contentGaps?: string[];
|
|
3975
|
+
} | null;
|
|
3976
|
+
/** Format: date-time */
|
|
3977
|
+
classifiedAt: string | null;
|
|
3978
|
+
classificationError: string | null;
|
|
3979
|
+
/** Format: date-time */
|
|
3980
|
+
createdAt: string;
|
|
3981
|
+
/** Format: date-time */
|
|
3982
|
+
updatedAt: string;
|
|
3983
|
+
};
|
|
3984
|
+
};
|
|
3985
|
+
};
|
|
3986
|
+
};
|
|
3987
|
+
};
|
|
3988
|
+
}
|
|
3989
|
+
declare namespace types_d_exports {
|
|
3990
|
+
export { ApplyIssuesParams, ApplyIssuesResponse, ClassifyConversationParams, ContextListenOptions, ContextRequestOptions, Conversation, ConversationDoc, CreateFileImportParams, CreateImportParams, CreateInstructionParams, CreateInstructionResponse, CreateKnowledgeBaseParams, DismissIssueResponse, EditInstructionParams, EditKnowledgeBaseParams, Entry, EntryDoc, Import, ImportDetail, ImportDownloadResponse, ImportsResponse, Instruction, InstructionDoc, IssueDoc, Job, JobAccepted, KnowledgeBase, KnowledgeBasesResponse, McpDoc, RebuildEntryResponse, ReopenIssueResponse, RequestOptions$2 as RequestOptions, ResolveIssueParams, ResolveIssueResponse, SaveConversationParams, Source, SourceContentResponse, SourceDetail, SourcesResponse, StagedUpload, possibleStoreRequestOptions };
|
|
3991
|
+
}
|
|
3992
|
+
/** Options accepted by every Context method. @beta */
|
|
3993
|
+
type RequestOptions$2 = {
|
|
3994
|
+
signal?: AbortSignal;
|
|
3995
|
+
tag?: string;
|
|
3996
|
+
};
|
|
3997
|
+
/** @internal */
|
|
3998
|
+
declare const possibleStoreRequestOptions: readonly ['headers', 'signal', 'tag', 'timeout', 'token'];
|
|
3999
|
+
/**
|
|
4000
|
+
* Request options honored by `context.fetch`.
|
|
4001
|
+
*
|
|
4002
|
+
* @beta
|
|
4003
|
+
*/
|
|
4004
|
+
type ContextRequestOptions = Pick<RequestOptions$1, (typeof possibleStoreRequestOptions)[number]>;
|
|
4005
|
+
/**
|
|
4006
|
+
* Listener options for `context.listen`.
|
|
4007
|
+
*
|
|
4008
|
+
* `includeAllVersions` is left out: Context documents are written by the
|
|
4009
|
+
* Context API with no drafts or versions, so it would never make a
|
|
4010
|
+
* difference.
|
|
4011
|
+
*
|
|
4012
|
+
* @beta
|
|
4013
|
+
*/
|
|
4014
|
+
type ContextListenOptions = Omit<ListenOptions, 'includeAllVersions'> | Omit<ResumableListenOptions, 'includeAllVersions'>;
|
|
4015
|
+
/**
|
|
4016
|
+
* A file import. The client stages the upload, PUTs the bytes straight to
|
|
4017
|
+
* storage with a signed URL, and confirms. The Context API never holds the
|
|
4018
|
+
* file content.
|
|
4019
|
+
* @beta
|
|
4020
|
+
*/
|
|
4021
|
+
type CreateFileImportParams = {
|
|
4022
|
+
type: 'file';
|
|
4023
|
+
/** Same shapes `assets.upload` accepts, minus node streams: the bytes go
|
|
4024
|
+
* out through `fetch`, which has no portable stream support. */
|
|
4025
|
+
file: Exclude<UploadBody, NodeJS.ReadableStream>;
|
|
4026
|
+
filename: string;
|
|
4027
|
+
contentType?: string;
|
|
4028
|
+
};
|
|
4029
|
+
type KnowledgeBasesPath = '/{apiVersion}/context/knowledge-bases';
|
|
4030
|
+
type ConversationPath = '/{apiVersion}/context/organizations/{organizationId}/conversations/{threadId}';
|
|
4031
|
+
type KnowledgeBasePath = '/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}';
|
|
4032
|
+
type ImportsPath = `${KnowledgeBasePath}/imports`;
|
|
4033
|
+
type ImportPath = `${KnowledgeBasePath}/imports/{importId}`;
|
|
4034
|
+
type UploadsPath = `${KnowledgeBasePath}/imports/uploads`;
|
|
4035
|
+
type EntryRebuildPath = `${KnowledgeBasePath}/entries/{entryPath}/rebuild`;
|
|
4036
|
+
type SourcesPath = `${KnowledgeBasePath}/sources`;
|
|
4037
|
+
type SourcePath = `${KnowledgeBasePath}/sources/{sourceId}`;
|
|
4038
|
+
type SourceContentPath = `${KnowledgeBasePath}/sources/{sourceId}/content`;
|
|
4039
|
+
type IssuesApplyPath = `${KnowledgeBasePath}/issues/apply`;
|
|
4040
|
+
type InstructionPath = `${KnowledgeBasePath}/instructions/{instructionId}`;
|
|
4041
|
+
type JobPath = `${KnowledgeBasePath}/jobs/{jobId}`;
|
|
4042
|
+
type IssueResolvePath = `${KnowledgeBasePath}/issues/{issueId}/resolve`;
|
|
4043
|
+
type IssueDismissPath = `${KnowledgeBasePath}/issues/{issueId}/dismiss`;
|
|
4044
|
+
type IssueReopenPath = `${KnowledgeBasePath}/issues/{issueId}/reopen`;
|
|
4045
|
+
type InstructionsPath = `${KnowledgeBasePath}/instructions`;
|
|
4046
|
+
type JsonResponse<T> = T extends {
|
|
4047
|
+
content: {
|
|
4048
|
+
'application/json': infer R;
|
|
4049
|
+
};
|
|
4050
|
+
} ? R : never;
|
|
4051
|
+
type JsonBody<T> = T extends {
|
|
4052
|
+
requestBody: {
|
|
4053
|
+
content: {
|
|
4054
|
+
'application/json': infer R;
|
|
4055
|
+
};
|
|
4056
|
+
};
|
|
4057
|
+
} ? R : never;
|
|
4058
|
+
/**
|
|
4059
|
+
* A knowledge base: one buildable body of knowledge inside Context.
|
|
4060
|
+
* @beta
|
|
4061
|
+
*/
|
|
4062
|
+
type KnowledgeBase = JsonResponse<paths[KnowledgeBasePath]['get']['responses']['200']>;
|
|
4063
|
+
/**
|
|
4064
|
+
* Parameters for creating a knowledge base.
|
|
4065
|
+
* @beta
|
|
4066
|
+
*/
|
|
4067
|
+
type CreateKnowledgeBaseParams = JsonBody<paths[KnowledgeBasesPath]['post']>;
|
|
4068
|
+
/** @beta */
|
|
4069
|
+
type EditKnowledgeBaseParams = JsonBody<paths[KnowledgeBasePath]['patch']>;
|
|
4070
|
+
/**
|
|
4071
|
+
* Parameters for importing content. Discriminated on `type`:
|
|
4072
|
+
* inline text, a website crawl, or a Sanity dataset bind.
|
|
4073
|
+
* @beta
|
|
4074
|
+
*/
|
|
4075
|
+
type CreateImportParams = JsonBody<paths[ImportsPath]['post']>;
|
|
4076
|
+
/**
|
|
4077
|
+
* Accepted async work. Poll the job with `jobs.get` until it reaches a
|
|
4078
|
+
* terminal state.
|
|
4079
|
+
* @beta
|
|
4080
|
+
*/
|
|
4081
|
+
type JobAccepted = JsonResponse<paths[`${KnowledgeBasePath}/build`]['post']['responses']['202']>;
|
|
4082
|
+
/** @beta */
|
|
4083
|
+
type Job = JsonResponse<paths[JobPath]['get']['responses']['200']>;
|
|
4084
|
+
/**
|
|
4085
|
+
* Accepted entry rebuild: the job to poll plus every entry the rebuild
|
|
4086
|
+
* touches.
|
|
4087
|
+
* @beta
|
|
4088
|
+
*/
|
|
4089
|
+
type RebuildEntryResponse = JsonResponse<paths[EntryRebuildPath]['post']['responses']['202']>;
|
|
4090
|
+
/** @beta */
|
|
4091
|
+
type ApplyIssuesParams = JsonBody<paths[IssuesApplyPath]['post']>;
|
|
4092
|
+
/** @beta */
|
|
4093
|
+
type ApplyIssuesResponse = JsonResponse<paths[IssuesApplyPath]['post']['responses']['202']>;
|
|
4094
|
+
/** @beta */
|
|
4095
|
+
type ResolveIssueParams = JsonBody<paths[IssueResolvePath]['post']>;
|
|
4096
|
+
/** @beta */
|
|
4097
|
+
type ResolveIssueResponse = JsonResponse<paths[IssueResolvePath]['post']['responses']['200']>;
|
|
4098
|
+
/** @beta */
|
|
4099
|
+
type DismissIssueResponse = JsonResponse<paths[IssueDismissPath]['post']['responses']['200']>;
|
|
4100
|
+
/** @beta */
|
|
4101
|
+
type ReopenIssueResponse = JsonResponse<paths[IssueReopenPath]['post']['responses']['200']>;
|
|
4102
|
+
/** @beta */
|
|
4103
|
+
type CreateInstructionParams = JsonBody<paths[InstructionsPath]['post']>;
|
|
4104
|
+
/**
|
|
4105
|
+
* A standing instruction, as the instruction endpoints return it.
|
|
4106
|
+
* @beta
|
|
4107
|
+
*/
|
|
4108
|
+
type Instruction = JsonResponse<paths[InstructionPath]['patch']['responses']['200']>;
|
|
4109
|
+
/** The created instruction, wrapped the way the create endpoint returns it. @beta */
|
|
4110
|
+
type CreateInstructionResponse = JsonResponse<paths[InstructionsPath]['post']['responses']['201']>;
|
|
4111
|
+
/** @beta */
|
|
4112
|
+
type EditInstructionParams = JsonBody<paths[InstructionPath]['patch']>;
|
|
4113
|
+
/** @beta */
|
|
4114
|
+
type KnowledgeBasesResponse = JsonResponse<paths[KnowledgeBasesPath]['get']['responses']['200']>;
|
|
4115
|
+
/** @beta */
|
|
4116
|
+
type ImportsResponse = JsonResponse<paths[ImportsPath]['get']['responses']['200']>;
|
|
4117
|
+
/** @beta */
|
|
4118
|
+
type Import = ImportsResponse['data'][number];
|
|
4119
|
+
/** @beta */
|
|
4120
|
+
type ImportDetail = JsonResponse<paths[ImportPath]['get']['responses']['200']>;
|
|
4121
|
+
/** @beta */
|
|
4122
|
+
type ImportDownloadResponse = JsonResponse<paths[`${ImportPath}/download`]['get']['responses']['200']>;
|
|
4123
|
+
/**
|
|
4124
|
+
* The staged half of a file upload: PUT the bytes to `uploadUrl`, then
|
|
4125
|
+
* confirm with the complete endpoint. `imports.create({type: 'file'})` does
|
|
4126
|
+
* all of this in one call.
|
|
4127
|
+
* @beta
|
|
4128
|
+
*/
|
|
4129
|
+
type StagedUpload = JsonResponse<paths[UploadsPath]['post']['responses']['201']>;
|
|
4130
|
+
/** @beta */
|
|
4131
|
+
type SourcesResponse = JsonResponse<paths[SourcesPath]['get']['responses']['200']>;
|
|
4132
|
+
/** @beta */
|
|
4133
|
+
type Source = SourcesResponse['data'][number];
|
|
4134
|
+
/** @beta */
|
|
4135
|
+
type SourceDetail = JsonResponse<paths[SourcePath]['get']['responses']['200']>;
|
|
4136
|
+
/** @beta */
|
|
4137
|
+
type SourceContentResponse = JsonResponse<paths[SourceContentPath]['get']['responses']['200']>;
|
|
4138
|
+
/**
|
|
4139
|
+
* A recorded conversation: one agent thread's transcript plus the
|
|
4140
|
+
* classification recorded on it. Standalone org-level telemetry — dimensions
|
|
4141
|
+
* (MCP endpoints, app, the customer's own keys) live in the `metadata` bag.
|
|
4142
|
+
* @beta
|
|
4143
|
+
*/
|
|
4144
|
+
type Conversation = JsonResponse<paths[ConversationPath]['put']['responses']['200']>;
|
|
4145
|
+
/**
|
|
4146
|
+
* Body for the conversation ingest upsert. Messages replace the stored
|
|
4147
|
+
* transcript wholesale; `metadata` and model fields only overwrite when
|
|
4148
|
+
* present.
|
|
4149
|
+
* @beta
|
|
4150
|
+
*/
|
|
4151
|
+
type SaveConversationParams = JsonBody<paths[ConversationPath]['put']>;
|
|
4152
|
+
/** Exactly one of a verdict (`coreMetrics`) or a failure (`classificationError`). @beta */
|
|
4153
|
+
type ClassifyConversationParams = JsonBody<paths[ConversationPath]['patch']>;
|
|
4154
|
+
/**
|
|
4155
|
+
* The raw `sanity.context.entry` document shape, as stored in the
|
|
4156
|
+
* organization's document store. For typing GROQ reads.
|
|
4157
|
+
* @beta
|
|
4158
|
+
*/
|
|
4159
|
+
type EntryDoc = components['schemas']['EntryDoc'];
|
|
4160
|
+
/** @beta */
|
|
4161
|
+
type IssueDoc = components['schemas']['IssueDoc'];
|
|
4162
|
+
/** @beta */
|
|
4163
|
+
type InstructionDoc = components['schemas']['InstructionDoc'];
|
|
4164
|
+
/**
|
|
4165
|
+
* The raw `sanity.context.mcp` document shape (an MCP endpoint
|
|
4166
|
+
* configuration), as stored in the organization's document store. For
|
|
4167
|
+
* typing GROQ reads.
|
|
4168
|
+
* @beta
|
|
4169
|
+
*/
|
|
4170
|
+
type McpDoc = components['schemas']['McpDoc'];
|
|
4171
|
+
/**
|
|
4172
|
+
* The metadata view of an entry, as `entries.list` projects it. Bodies stay
|
|
4173
|
+
* behind `entries.get` (or a GROQ read through `context.fetch`).
|
|
4174
|
+
* @beta
|
|
4175
|
+
*/
|
|
4176
|
+
type Entry = Pick<EntryDoc, '_id' | 'path' | 'title' | 'tldr' | 'status'>;
|
|
4177
|
+
/**
|
|
4178
|
+
* The raw `sanity.context.conversation` document shape, as stored in the
|
|
4179
|
+
* organization's document store. For typing GROQ reads.
|
|
4180
|
+
* @beta
|
|
4181
|
+
*/
|
|
4182
|
+
type ConversationDoc = components['schemas']['ConversationDoc'];
|
|
4183
|
+
type ListOptions$1 = RequestOptions$2 & {
|
|
4184
|
+
cursor?: string;
|
|
4185
|
+
limit?: number;
|
|
4186
|
+
};
|
|
4187
|
+
/**
|
|
4188
|
+
* `client.context` — knowledge bases and everything scoped to them.
|
|
4189
|
+
*
|
|
4190
|
+
* Collection-level management (create, list, get, edit, delete) addresses
|
|
4191
|
+
* knowledge bases per call, like `client.projects`. Everything scoped to one
|
|
4192
|
+
* knowledge base (imports, builds, issues, entries, ...) operates on the
|
|
4193
|
+
* client's configured `resource`, like media libraries:
|
|
4194
|
+
*
|
|
4195
|
+
* @example Full lifecycle
|
|
4196
|
+
* ```ts
|
|
4197
|
+
* const created = await client.context.knowledgeBases.create({
|
|
4198
|
+
* organizationId: 'org123',
|
|
4199
|
+
* title: 'Support docs',
|
|
4200
|
+
* description: 'Product docs and troubleshooting guides',
|
|
4201
|
+
* })
|
|
4202
|
+
*
|
|
4203
|
+
* const kb = createClient({
|
|
4204
|
+
* apiVersion: '2026-08-25',
|
|
4205
|
+
* token,
|
|
4206
|
+
* resource: {type: 'knowledge-base', id: created.publicId},
|
|
4207
|
+
* })
|
|
4208
|
+
*
|
|
4209
|
+
* await kb.context.imports.create({type: 'text', title: 'Refund policy', content: refundMd})
|
|
4210
|
+
* const {jobId} = await kb.context.build()
|
|
4211
|
+
* ```
|
|
4212
|
+
*
|
|
4213
|
+
* @beta
|
|
4214
|
+
*/
|
|
4215
|
+
declare class ContextClient {
|
|
4216
|
+
#private;
|
|
4217
|
+
constructor(client: SanityClient$1, httpRequest: HttpRequest);
|
|
4218
|
+
/** The knowledge base collection: management addressed per call. */
|
|
4219
|
+
knowledgeBases: {
|
|
4220
|
+
/** Create a knowledge base. Requires the org-level knowledge-base create grant. */
|
|
4221
|
+
create: (params: CreateKnowledgeBaseParams, options?: RequestOptions$2) => Promise<KnowledgeBase>;
|
|
4222
|
+
/** List the organization's knowledge bases. */
|
|
4223
|
+
list: (params: {
|
|
4224
|
+
organizationId: string;
|
|
4225
|
+
} & ListOptions$1) => Promise<KnowledgeBasesResponse>;
|
|
4226
|
+
/** Fetch a knowledge base by its id. */
|
|
4227
|
+
get: (knowledgeBaseId: string, options?: RequestOptions$2) => Promise<KnowledgeBase>;
|
|
4228
|
+
/** Edit a knowledge base's configuration. */
|
|
4229
|
+
edit: (knowledgeBaseId: string, params: EditKnowledgeBaseParams, options?: RequestOptions$2) => Promise<KnowledgeBase>;
|
|
4230
|
+
/** Delete a knowledge base and its generated content. */
|
|
4231
|
+
delete: (knowledgeBaseId: string, options?: RequestOptions$2) => Promise<void>;
|
|
4232
|
+
};
|
|
4233
|
+
/**
|
|
4234
|
+
* GROQ over the organization's Context documents (conversation telemetry
|
|
4235
|
+
* today; the store holds every Context family and the caller's access
|
|
4236
|
+
* decides what a query returns, so filter on `_type`).
|
|
4237
|
+
*
|
|
4238
|
+
* Requires `context.organizationId` in the client configuration.
|
|
4239
|
+
*/
|
|
4240
|
+
fetch<R = unknown>(query: string, params?: QueryParams, options?: ContextRequestOptions): Promise<R>;
|
|
4241
|
+
/**
|
|
4242
|
+
* Listen for changes to the organization's Context documents. Mirrors
|
|
4243
|
+
* `client.listen(query, params, options)` and emits mutation events by
|
|
4244
|
+
* default.
|
|
4245
|
+
*/
|
|
4246
|
+
listen<Opts extends ContextListenOptions | undefined = undefined>(query: string, params?: QueryParams, options?: Opts): Observable<ListenEventFromOptions<SanityDocument$1, Opts>>;
|
|
4247
|
+
/**
|
|
4248
|
+
* Conversation telemetry. `threadId` identifies the conversation within
|
|
4249
|
+
* the organization — reuse means the same conversation. Beyond the canned
|
|
4250
|
+
* `get`, reads go through {@link fetch} and {@link listen} with GROQ
|
|
4251
|
+
* (`_type == "sanity.context.conversation"`).
|
|
4252
|
+
*
|
|
4253
|
+
* Requires `context.organizationId` in the client configuration.
|
|
4254
|
+
*/
|
|
4255
|
+
conversations: {
|
|
4256
|
+
/**
|
|
4257
|
+
* Record a conversation. Messages replace the stored transcript
|
|
4258
|
+
* wholesale; `metadata` and model fields only overwrite when present.
|
|
4259
|
+
* Last write per thread wins — retries are safe.
|
|
4260
|
+
*/
|
|
4261
|
+
save: (params: {
|
|
4262
|
+
threadId: string;
|
|
4263
|
+
} & SaveConversationParams, options?: RequestOptions$2) => Promise<Conversation>;
|
|
4264
|
+
/**
|
|
4265
|
+
* Record the classification your own model produced for one thread:
|
|
4266
|
+
* exactly one of `coreMetrics` (a verdict) or `classificationError`
|
|
4267
|
+
* (why classification failed).
|
|
4268
|
+
*/
|
|
4269
|
+
classify: (params: {
|
|
4270
|
+
threadId: string;
|
|
4271
|
+
} & ClassifyConversationParams, options?: RequestOptions$2) => Promise<Conversation>;
|
|
4272
|
+
/**
|
|
4273
|
+
* One recorded conversation by its thread id, or `null` when the thread
|
|
4274
|
+
* was never recorded. Runs:
|
|
4275
|
+
*
|
|
4276
|
+
* `*[_type == "sanity.context.conversation" && organizationId == $org && threadId == $threadId][0]`
|
|
4277
|
+
*
|
|
4278
|
+
* For anything more, use {@link fetch}.
|
|
4279
|
+
*/
|
|
4280
|
+
get: (params: {
|
|
4281
|
+
threadId: string;
|
|
4282
|
+
}, options?: ContextRequestOptions) => Promise<ConversationDoc | null>;
|
|
4283
|
+
};
|
|
4284
|
+
/**
|
|
4285
|
+
* Build the configured knowledge base. The server waits for pending import
|
|
4286
|
+
* processing before assembling, so importing and building back to back is
|
|
4287
|
+
* safe. Track the returned job with {@link jobs}.
|
|
4288
|
+
*/
|
|
4289
|
+
build(options?: RequestOptions$2): Promise<JobAccepted>;
|
|
4290
|
+
/** Cancel the running build, if any. */
|
|
4291
|
+
cancelBuild(options?: RequestOptions$2): Promise<{
|
|
4292
|
+
cancelled: boolean;
|
|
4293
|
+
}>;
|
|
4294
|
+
/** Run an incremental refresh: re-check sources and apply what changed. */
|
|
4295
|
+
refresh(options?: RequestOptions$2): Promise<{
|
|
4296
|
+
jobId: string;
|
|
4297
|
+
started: boolean;
|
|
4298
|
+
}>;
|
|
4299
|
+
/** Imports: feed content into the configured knowledge base. */
|
|
4300
|
+
imports: {
|
|
4301
|
+
/**
|
|
4302
|
+
* Import content. One entry point, discriminated on `type`: inline
|
|
4303
|
+
* `text`, a website `crawl`, a Sanity `dataset` bind, or a `file`
|
|
4304
|
+
* upload. Processing queues automatically. The file variant stages the
|
|
4305
|
+
* upload, PUTs the bytes to a signed storage URL, and confirms; the
|
|
4306
|
+
* bytes never pass through the Context API.
|
|
4307
|
+
*/
|
|
4308
|
+
create: (params: CreateImportParams | CreateFileImportParams, options?: RequestOptions$2) => Promise<JobAccepted>;
|
|
4309
|
+
list: (params?: ListOptions$1) => Promise<{
|
|
4310
|
+
data: {
|
|
4311
|
+
id: string;
|
|
4312
|
+
knowledgeBaseId: string;
|
|
4313
|
+
name: string | null;
|
|
4314
|
+
sizeBytes: number | null;
|
|
4315
|
+
status: 'uploading' | 'processing' | 'complete' | 'failed';
|
|
4316
|
+
sourceKind: 'web' | 'file' | 'dataset';
|
|
4317
|
+
lastCheckedAt: string | null;
|
|
4318
|
+
sourceCount: number;
|
|
4319
|
+
totalDistillableCount: number;
|
|
4320
|
+
distilledCount: number;
|
|
4321
|
+
unsupportedCount: number;
|
|
4322
|
+
statusDetail: string | null;
|
|
4323
|
+
error: string | null;
|
|
4324
|
+
crawlOptions: {
|
|
4325
|
+
includePaths?: string[];
|
|
4326
|
+
excludePaths?: string[];
|
|
4327
|
+
maxDepth?: number;
|
|
4328
|
+
sitemapOnly?: boolean;
|
|
4329
|
+
ignoreQueryParameters?: boolean;
|
|
4330
|
+
pageLimit?: number;
|
|
4331
|
+
} | null;
|
|
4332
|
+
datasetSource: {
|
|
4333
|
+
sanityProjectId: string;
|
|
4334
|
+
sanityDatasetId: string;
|
|
4335
|
+
query: string;
|
|
4336
|
+
} | null;
|
|
4337
|
+
createdBy: {
|
|
4338
|
+
id: string | null;
|
|
4339
|
+
displayName: string | null;
|
|
4340
|
+
} | null;
|
|
4341
|
+
createdAt: string;
|
|
4342
|
+
completedAt: string | null;
|
|
4343
|
+
}[];
|
|
4344
|
+
nextCursor: string | null;
|
|
4345
|
+
}>;
|
|
4346
|
+
get: (params: {
|
|
4347
|
+
importId: string;
|
|
4348
|
+
}, options?: RequestOptions$2) => Promise<{
|
|
4349
|
+
id: string;
|
|
4350
|
+
knowledgeBaseId: string;
|
|
4351
|
+
name: string | null;
|
|
4352
|
+
sizeBytes: number | null;
|
|
4353
|
+
status: 'uploading' | 'processing' | 'complete' | 'failed';
|
|
4354
|
+
sourceKind: 'web' | 'file' | 'dataset';
|
|
4355
|
+
lastCheckedAt: string | null;
|
|
4356
|
+
sourceCount: number;
|
|
4357
|
+
totalDistillableCount: number;
|
|
4358
|
+
distilledCount: number;
|
|
4359
|
+
unsupportedCount: number;
|
|
4360
|
+
statusDetail: string | null;
|
|
4361
|
+
error: string | null;
|
|
4362
|
+
crawlOptions: {
|
|
4363
|
+
includePaths?: string[];
|
|
4364
|
+
excludePaths?: string[];
|
|
4365
|
+
maxDepth?: number;
|
|
4366
|
+
sitemapOnly?: boolean;
|
|
4367
|
+
ignoreQueryParameters?: boolean;
|
|
4368
|
+
pageLimit?: number;
|
|
4369
|
+
} | null;
|
|
4370
|
+
datasetSource: {
|
|
4371
|
+
sanityProjectId: string;
|
|
4372
|
+
sanityDatasetId: string;
|
|
4373
|
+
query: string;
|
|
4374
|
+
} | null;
|
|
4375
|
+
createdBy: {
|
|
4376
|
+
id: string | null;
|
|
4377
|
+
displayName: string | null;
|
|
4378
|
+
} | null;
|
|
4379
|
+
createdAt: string;
|
|
4380
|
+
completedAt: string | null;
|
|
4381
|
+
}>;
|
|
4382
|
+
/** A short-lived signed URL for the original uploaded bytes. */
|
|
4383
|
+
download: (params: {
|
|
4384
|
+
importId: string;
|
|
4385
|
+
}, options?: RequestOptions$2) => Promise<{
|
|
4386
|
+
url: string;
|
|
4387
|
+
expiresAt: string;
|
|
4388
|
+
}>;
|
|
4389
|
+
delete: (params: {
|
|
4390
|
+
importId: string;
|
|
4391
|
+
}, options?: RequestOptions$2) => Promise<void>;
|
|
4392
|
+
};
|
|
4393
|
+
/** Jobs: poll async work (builds, imports) to a terminal state. */
|
|
4394
|
+
jobs: {
|
|
4395
|
+
get: (params: {
|
|
4396
|
+
jobId: string;
|
|
4397
|
+
}, options?: RequestOptions$2) => Promise<{
|
|
4398
|
+
id: string;
|
|
4399
|
+
status: 'pending' | 'queued' | 'running' | 'succeeded' | 'failed' | 'cancelled';
|
|
4400
|
+
startedAt: string | null;
|
|
4401
|
+
completedAt: string | null;
|
|
4402
|
+
result?: unknown;
|
|
4403
|
+
error?: string | null;
|
|
4404
|
+
}>;
|
|
4405
|
+
};
|
|
4406
|
+
/**
|
|
4407
|
+
* Issues: findings from builds awaiting triage. Reads are canned GROQ
|
|
4408
|
+
* queries against the organization's document store; for anything more,
|
|
4409
|
+
* use {@link fetch}. Reads require `context.organizationId` alongside the
|
|
4410
|
+
* knowledge-base `resource` in the client configuration.
|
|
4411
|
+
*/
|
|
4412
|
+
issues: {
|
|
4413
|
+
/**
|
|
4414
|
+
* Every issue on the knowledge base, oldest first, optionally narrowed
|
|
4415
|
+
* to one status. Drains keyset pages internally and resolves with the
|
|
4416
|
+
* complete set. Runs:
|
|
4417
|
+
*
|
|
4418
|
+
* `*[_type == "sanity.context.issue" && knowledgeBaseId == $kb && status == $status] | order(_createdAt asc, _id asc)`
|
|
4419
|
+
*
|
|
4420
|
+
* (the status clause only when given). For anything more, use {@link fetch}.
|
|
4421
|
+
*/
|
|
4422
|
+
list: (params?: {
|
|
4423
|
+
status?: 'open' | 'accepted' | 'rejected';
|
|
4424
|
+
}, options?: ContextRequestOptions) => Promise<IssueDoc[]>;
|
|
4425
|
+
/**
|
|
4426
|
+
* One issue by its document id, or `null` when it does not exist. Runs:
|
|
4427
|
+
*
|
|
4428
|
+
* `*[_type == "sanity.context.issue" && knowledgeBaseId == $kb && _id == $id][0]`
|
|
4429
|
+
*
|
|
4430
|
+
* For anything more, use {@link fetch}.
|
|
4431
|
+
*/
|
|
4432
|
+
get: (params: {
|
|
4433
|
+
issueId: string;
|
|
4434
|
+
}, options?: ContextRequestOptions) => Promise<IssueDoc | null>;
|
|
4435
|
+
/** Resolve a conflict issue. Mints the standing instruction, same as the dashboard. */
|
|
4436
|
+
resolve: (params: {
|
|
4437
|
+
issueId: string;
|
|
4438
|
+
} & ResolveIssueParams, options?: RequestOptions$2) => Promise<{
|
|
4439
|
+
issue: {
|
|
4440
|
+
id: string;
|
|
4441
|
+
knowledgeBaseId: string;
|
|
4442
|
+
content: {
|
|
4443
|
+
kind: 'conflict' | 'gap' | 'update_required' | 'add_entry' | 'remove_entry' | 'split_entry' | 'merge_entry';
|
|
4444
|
+
severity: 'critical' | 'suggestion';
|
|
4445
|
+
scopePath: string;
|
|
4446
|
+
issue: string;
|
|
4447
|
+
suggestedFix: string;
|
|
4448
|
+
citedSourceIds?: string[];
|
|
4449
|
+
claimKey?: string;
|
|
4450
|
+
involvedScopes?: string[];
|
|
4451
|
+
currentClaim?: string;
|
|
4452
|
+
alternativeClaim?: string;
|
|
4453
|
+
currentAuthority?: 'primary' | 'secondary' | 'community';
|
|
4454
|
+
alternativeAuthority?: 'primary' | 'secondary' | 'community';
|
|
4455
|
+
suggestedResolution?: 'keep_existing' | 'accept_new';
|
|
4456
|
+
};
|
|
4457
|
+
status: 'open' | 'accepted' | 'rejected';
|
|
4458
|
+
resolution: 'keep_existing' | 'accept_new' | null;
|
|
4459
|
+
resolvedBy: {
|
|
4460
|
+
id: string;
|
|
4461
|
+
kind: 'user' | 'robot';
|
|
4462
|
+
} | null;
|
|
4463
|
+
createdAt: string;
|
|
4464
|
+
resolvedAt: string | null;
|
|
4465
|
+
};
|
|
4466
|
+
jobId: string | null;
|
|
4467
|
+
}>;
|
|
4468
|
+
dismiss: (params: {
|
|
4469
|
+
issueId: string;
|
|
4470
|
+
}, options?: RequestOptions$2) => Promise<{
|
|
4471
|
+
id: string;
|
|
4472
|
+
knowledgeBaseId: string;
|
|
4473
|
+
content: {
|
|
4474
|
+
kind: 'conflict' | 'gap' | 'update_required' | 'add_entry' | 'remove_entry' | 'split_entry' | 'merge_entry';
|
|
4475
|
+
severity: 'critical' | 'suggestion';
|
|
4476
|
+
scopePath: string;
|
|
4477
|
+
issue: string;
|
|
4478
|
+
suggestedFix: string;
|
|
4479
|
+
citedSourceIds?: string[];
|
|
4480
|
+
claimKey?: string;
|
|
4481
|
+
involvedScopes?: string[];
|
|
4482
|
+
currentClaim?: string;
|
|
4483
|
+
alternativeClaim?: string;
|
|
4484
|
+
currentAuthority?: 'primary' | 'secondary' | 'community';
|
|
4485
|
+
alternativeAuthority?: 'primary' | 'secondary' | 'community';
|
|
4486
|
+
suggestedResolution?: 'keep_existing' | 'accept_new';
|
|
4487
|
+
};
|
|
4488
|
+
status: 'open' | 'accepted' | 'rejected';
|
|
4489
|
+
resolution: 'keep_existing' | 'accept_new' | null;
|
|
4490
|
+
resolvedBy: {
|
|
4491
|
+
id: string;
|
|
4492
|
+
kind: 'user' | 'robot';
|
|
4493
|
+
} | null;
|
|
4494
|
+
createdAt: string;
|
|
4495
|
+
resolvedAt: string | null;
|
|
4496
|
+
}>;
|
|
4497
|
+
reopen: (params: {
|
|
4498
|
+
issueId: string;
|
|
4499
|
+
}, options?: RequestOptions$2) => Promise<{
|
|
4500
|
+
id: string;
|
|
4501
|
+
knowledgeBaseId: string;
|
|
4502
|
+
content: {
|
|
4503
|
+
kind: 'conflict' | 'gap' | 'update_required' | 'add_entry' | 'remove_entry' | 'split_entry' | 'merge_entry';
|
|
4504
|
+
severity: 'critical' | 'suggestion';
|
|
4505
|
+
scopePath: string;
|
|
4506
|
+
issue: string;
|
|
4507
|
+
suggestedFix: string;
|
|
4508
|
+
citedSourceIds?: string[];
|
|
4509
|
+
claimKey?: string;
|
|
4510
|
+
involvedScopes?: string[];
|
|
4511
|
+
currentClaim?: string;
|
|
4512
|
+
alternativeClaim?: string;
|
|
4513
|
+
currentAuthority?: 'primary' | 'secondary' | 'community';
|
|
4514
|
+
alternativeAuthority?: 'primary' | 'secondary' | 'community';
|
|
4515
|
+
suggestedResolution?: 'keep_existing' | 'accept_new';
|
|
4516
|
+
};
|
|
4517
|
+
status: 'open' | 'accepted' | 'rejected';
|
|
4518
|
+
resolution: 'keep_existing' | 'accept_new' | null;
|
|
4519
|
+
resolvedBy: {
|
|
4520
|
+
id: string;
|
|
4521
|
+
kind: 'user' | 'robot';
|
|
4522
|
+
} | null;
|
|
4523
|
+
createdAt: string;
|
|
4524
|
+
resolvedAt: string | null;
|
|
4525
|
+
}>;
|
|
4526
|
+
/** Apply already-accepted issues to the knowledge base in one batch. */
|
|
4527
|
+
apply: (params: ApplyIssuesParams, options?: RequestOptions$2) => Promise<{
|
|
4528
|
+
jobId: string;
|
|
4529
|
+
}>;
|
|
4530
|
+
};
|
|
4531
|
+
/** Instructions: standing decisions that steer every build. */
|
|
4532
|
+
instructions: {
|
|
4533
|
+
create: (params: CreateInstructionParams, options?: RequestOptions$2) => Promise<CreateInstructionResponse>;
|
|
4534
|
+
/**
|
|
4535
|
+
* Every current-schema instruction on the knowledge base, oldest first.
|
|
4536
|
+
* Drains keyset pages internally and resolves with the complete set.
|
|
4537
|
+
* Runs:
|
|
4538
|
+
*
|
|
4539
|
+
* `*[_type == "sanity.context.instruction" && knowledgeBaseId == $kb && schemaVersion == 1] | order(_createdAt asc, _id asc)`
|
|
4540
|
+
*
|
|
4541
|
+
* For anything more, use {@link fetch}. Requires `context.organizationId`
|
|
4542
|
+
* alongside the knowledge-base `resource` in the client configuration.
|
|
4543
|
+
*/
|
|
4544
|
+
list: (options?: ContextRequestOptions) => Promise<InstructionDoc[]>;
|
|
4545
|
+
edit: (params: {
|
|
4546
|
+
instructionId: string;
|
|
4547
|
+
} & EditInstructionParams, options?: RequestOptions$2) => Promise<{
|
|
4548
|
+
id: string;
|
|
4549
|
+
knowledgeBaseId: string;
|
|
4550
|
+
origin: 'conflict' | 'human';
|
|
4551
|
+
status: 'active' | 'archived';
|
|
4552
|
+
statement: string;
|
|
4553
|
+
scopeSourceIds: string[] | null;
|
|
4554
|
+
archivedAt: string | null;
|
|
4555
|
+
archivedReason: string | null;
|
|
4556
|
+
sourceIssueId: string | null;
|
|
4557
|
+
createdBy: {
|
|
4558
|
+
id: string | null;
|
|
4559
|
+
displayName: string | null;
|
|
4560
|
+
} | null;
|
|
4561
|
+
updatedBy: {
|
|
4562
|
+
id: string | null;
|
|
4563
|
+
displayName: string | null;
|
|
4564
|
+
} | null;
|
|
4565
|
+
createdAt: string;
|
|
4566
|
+
updatedAt: string | null;
|
|
4567
|
+
}>;
|
|
4568
|
+
delete: (params: {
|
|
4569
|
+
instructionId: string;
|
|
4570
|
+
}, options?: RequestOptions$2) => Promise<void>;
|
|
4571
|
+
};
|
|
4572
|
+
/**
|
|
4573
|
+
* Entries: the built outline, one entry per node. Reads are canned GROQ
|
|
4574
|
+
* queries against the organization's document store; for anything more,
|
|
4575
|
+
* use {@link fetch}. Requires `context.organizationId` alongside the
|
|
4576
|
+
* knowledge-base `resource` in the client configuration.
|
|
4577
|
+
*/
|
|
4578
|
+
entries: {
|
|
4579
|
+
/**
|
|
4580
|
+
* Every entry, path-ordered, as a metadata view (`_id`, `path`,
|
|
4581
|
+
* `title`, `tldr`, `status`) with bodies excluded. Drains keyset pages
|
|
4582
|
+
* internally and resolves with the complete set. Runs:
|
|
4583
|
+
*
|
|
4584
|
+
* `*[_type == "sanity.context.entry" && knowledgeBaseId == $kb && path > $after] | order(path asc) [0...200] {_id, path, title, tldr, status}`
|
|
4585
|
+
*
|
|
4586
|
+
* For bodies, use `entries.get` or {@link fetch}.
|
|
4587
|
+
*/
|
|
4588
|
+
list: (options?: ContextRequestOptions) => Promise<Entry[]>;
|
|
4589
|
+
/**
|
|
4590
|
+
* One entry with its full body and citations, by outline path (e.g.
|
|
4591
|
+
* `billing/refunds`), or `null` when no entry sits at that path. Runs:
|
|
4592
|
+
*
|
|
4593
|
+
* `*[_type == "sanity.context.entry" && knowledgeBaseId == $kb && path == $path][0]`
|
|
4594
|
+
*
|
|
4595
|
+
* For anything more, use {@link fetch}.
|
|
4596
|
+
*/
|
|
4597
|
+
get: (params: {
|
|
4598
|
+
path: string;
|
|
4599
|
+
}, options?: ContextRequestOptions) => Promise<EntryDoc | null>;
|
|
4600
|
+
/**
|
|
4601
|
+
* Rebuild one entry from its already-placed sources, by outline path.
|
|
4602
|
+
* Poll the returned job with {@link jobs}; `affectedEntries` lists every
|
|
4603
|
+
* entry the rebuild touches.
|
|
4604
|
+
*/
|
|
4605
|
+
rebuild: (params: {
|
|
4606
|
+
path: string;
|
|
4607
|
+
}, options?: RequestOptions$2) => Promise<RebuildEntryResponse>;
|
|
4608
|
+
};
|
|
4609
|
+
/**
|
|
4610
|
+
* MCP endpoint configurations, org-owned documents read with canned GROQ
|
|
4611
|
+
* queries. Requires `context.organizationId` in the client configuration.
|
|
4612
|
+
*/
|
|
4613
|
+
mcpEndpoints: {
|
|
4614
|
+
/**
|
|
4615
|
+
* The organization's MCP endpoint configurations, oldest first. Runs:
|
|
4616
|
+
*
|
|
4617
|
+
* `*[_type == "sanity.context.mcp" && organizationId == $org] | order(_createdAt asc, _id asc) [0...500]`
|
|
4618
|
+
*
|
|
4619
|
+
* For anything more, use {@link fetch}.
|
|
4620
|
+
*/
|
|
4621
|
+
list: (options?: ContextRequestOptions) => Promise<McpDoc[]>;
|
|
4622
|
+
/**
|
|
4623
|
+
* One MCP endpoint configuration by its URL name, or `null` when none
|
|
4624
|
+
* carries that name. Runs:
|
|
4625
|
+
*
|
|
4626
|
+
* `*[_type == "sanity.context.mcp" && organizationId == $org && name == $name][0]`
|
|
4627
|
+
*
|
|
4628
|
+
* For anything more, use {@link fetch}.
|
|
4629
|
+
*/
|
|
4630
|
+
get: (params: {
|
|
4631
|
+
name: string;
|
|
4632
|
+
}, options?: ContextRequestOptions) => Promise<McpDoc | null>;
|
|
4633
|
+
};
|
|
4634
|
+
/** Sources: the distilled units builds cite. */
|
|
4635
|
+
sources: {
|
|
4636
|
+
/**
|
|
4637
|
+
* List sources, optionally filtered by `status` or the `importId` they
|
|
4638
|
+
* came from. `ids` is a lookup mode: it resolves those exact sources
|
|
4639
|
+
* (e.g. from an entry's citations) and overrides `status` and `cursor`.
|
|
4640
|
+
*/
|
|
4641
|
+
list: (params?: {
|
|
4642
|
+
status?: Source['status'];
|
|
4643
|
+
importId?: string;
|
|
4644
|
+
ids?: string[];
|
|
4645
|
+
} & ListOptions$1) => Promise<{
|
|
4646
|
+
data: {
|
|
4647
|
+
id: string;
|
|
4648
|
+
knowledgeBaseId: string;
|
|
4649
|
+
filename: string;
|
|
4650
|
+
kind: 'web' | 'file' | 'dataset';
|
|
4651
|
+
sizeBytes: number;
|
|
4652
|
+
status: 'pending' | 'processing' | 'ready' | 'failed' | 'skipped';
|
|
4653
|
+
tldr: string | null;
|
|
4654
|
+
topics: string[] | null;
|
|
4655
|
+
canonicalUrl: string | null;
|
|
4656
|
+
fetchedAt: string | null;
|
|
4657
|
+
distilledAt: string | null;
|
|
4658
|
+
createdAt: string;
|
|
4659
|
+
}[];
|
|
4660
|
+
nextCursor: string | null;
|
|
4661
|
+
}>;
|
|
4662
|
+
get: (params: {
|
|
4663
|
+
sourceId: string;
|
|
4664
|
+
}, options?: RequestOptions$2) => Promise<{
|
|
4665
|
+
id: string;
|
|
4666
|
+
knowledgeBaseId: string;
|
|
4667
|
+
filename: string;
|
|
4668
|
+
kind: 'web' | 'file' | 'dataset';
|
|
4669
|
+
sizeBytes: number;
|
|
4670
|
+
status: 'pending' | 'processing' | 'ready' | 'failed' | 'skipped';
|
|
4671
|
+
tldr: string | null;
|
|
4672
|
+
topics: string[] | null;
|
|
4673
|
+
canonicalUrl: string | null;
|
|
4674
|
+
fetchedAt: string | null;
|
|
4675
|
+
distilledAt: string | null;
|
|
4676
|
+
createdAt: string;
|
|
4677
|
+
}>;
|
|
4678
|
+
/**
|
|
4679
|
+
* Distilled source content, optionally a line range: the evidence behind
|
|
4680
|
+
* a citation or an issue.
|
|
4681
|
+
*/
|
|
4682
|
+
content: (params: {
|
|
4683
|
+
sourceId: string;
|
|
4684
|
+
startLine?: number;
|
|
4685
|
+
endLine?: number;
|
|
4686
|
+
}, options?: RequestOptions$2) => Promise<{
|
|
4687
|
+
sourceId: string;
|
|
4688
|
+
content: string;
|
|
4689
|
+
totalLines: number;
|
|
4690
|
+
slice: {
|
|
4691
|
+
start: number;
|
|
4692
|
+
end: number;
|
|
4693
|
+
};
|
|
4694
|
+
}>;
|
|
4695
|
+
delete: (params: {
|
|
4696
|
+
sourceId: string;
|
|
4697
|
+
}, options?: RequestOptions$2) => Promise<void>;
|
|
4698
|
+
};
|
|
4699
|
+
}
|
|
4700
|
+
/**
|
|
4701
|
+
* Observable counterpart of {@link ContextClient}. Collection-level
|
|
4702
|
+
* methods and the GROQ-backed reads; knowledge-base scoped write
|
|
4703
|
+
* operations are promise-based, so use the promise client
|
|
4704
|
+
* (`client.context`) for those.
|
|
4705
|
+
*
|
|
4706
|
+
* @beta
|
|
4707
|
+
*/
|
|
4708
|
+
declare class ObservableContextClient {
|
|
4709
|
+
#private;
|
|
4710
|
+
constructor(client: ObservableSanityClient$1, httpRequest: HttpRequest);
|
|
4711
|
+
/** The knowledge base collection: management addressed per call. */
|
|
4712
|
+
knowledgeBases: {
|
|
4713
|
+
/** Create a knowledge base. Requires the org-level knowledge-base create grant. */
|
|
4714
|
+
create: (params: CreateKnowledgeBaseParams, options?: RequestOptions$2) => Observable<KnowledgeBase>;
|
|
4715
|
+
/** List the organization's knowledge bases. */
|
|
4716
|
+
list: (params: {
|
|
4717
|
+
organizationId: string;
|
|
4718
|
+
} & ListOptions$1) => Observable<KnowledgeBasesResponse>;
|
|
4719
|
+
/** Fetch a knowledge base by its id. */
|
|
4720
|
+
get: (knowledgeBaseId: string, options?: RequestOptions$2) => Observable<KnowledgeBase>;
|
|
4721
|
+
/** Edit a knowledge base's configuration. */
|
|
4722
|
+
edit: (knowledgeBaseId: string, params: EditKnowledgeBaseParams, options?: RequestOptions$2) => Observable<KnowledgeBase>;
|
|
4723
|
+
/** Delete a knowledge base and its generated content. */
|
|
4724
|
+
delete: (knowledgeBaseId: string, options?: RequestOptions$2) => Observable<void>;
|
|
4725
|
+
};
|
|
4726
|
+
/**
|
|
4727
|
+
* GROQ over the organization's Context documents (conversation telemetry
|
|
4728
|
+
* today; the store holds every Context family and the caller's access
|
|
4729
|
+
* decides what a query returns, so filter on `_type`).
|
|
4730
|
+
*
|
|
4731
|
+
* Requires `context.organizationId` in the client configuration.
|
|
1605
4732
|
*/
|
|
1606
|
-
|
|
4733
|
+
fetch<R = unknown>(query: string, params?: QueryParams, options?: ContextRequestOptions): Observable<R>;
|
|
1607
4734
|
/**
|
|
1608
|
-
*
|
|
1609
|
-
*
|
|
1610
|
-
*
|
|
1611
|
-
* GET to a POST for queries too large for the request URL in the same way,
|
|
1612
|
-
* but queries the comments endpoint, which accepts none of the query options
|
|
1613
|
-
* `client.fetch` does (`perspective`, `useCdn`, `filterResponse`,
|
|
1614
|
-
* `resultSourceMap`, stega).
|
|
1615
|
-
*
|
|
1616
|
-
* The query runs against the organization store, which is not scoped to
|
|
1617
|
-
* comments, so filter on `_type == "sanity.comment"`.
|
|
1618
|
-
*
|
|
1619
|
-
* @param query - GROQ-query to perform
|
|
1620
|
-
* @param params - Optional query parameters
|
|
1621
|
-
* @param options - Optional request options
|
|
4735
|
+
* Listen for changes to the organization's Context documents. Mirrors
|
|
4736
|
+
* `client.listen(query, params, options)` and emits mutation events by
|
|
4737
|
+
* default.
|
|
1622
4738
|
*/
|
|
1623
|
-
|
|
4739
|
+
listen<Opts extends ContextListenOptions | undefined = undefined>(query: string, params?: QueryParams, options?: Opts): Observable<ListenEventFromOptions<SanityDocument$1, Opts>>;
|
|
1624
4740
|
/**
|
|
1625
|
-
*
|
|
1626
|
-
*
|
|
1627
|
-
*
|
|
4741
|
+
* Conversation telemetry. `threadId` identifies the conversation within
|
|
4742
|
+
* the organization — reuse means the same conversation. Beyond the canned
|
|
4743
|
+
* `get`, reads go through {@link fetch} and {@link listen} with GROQ
|
|
4744
|
+
* (`_type == "sanity.context.conversation"`).
|
|
1628
4745
|
*
|
|
1629
|
-
*
|
|
1630
|
-
* @param params - Optional query parameters
|
|
4746
|
+
* Requires `context.organizationId` in the client configuration.
|
|
1631
4747
|
*/
|
|
1632
|
-
|
|
4748
|
+
conversations: {
|
|
4749
|
+
/**
|
|
4750
|
+
* Record a conversation. Messages replace the stored transcript
|
|
4751
|
+
* wholesale; `metadata` and model fields only overwrite when present.
|
|
4752
|
+
* Last write per thread wins — retries are safe.
|
|
4753
|
+
*/
|
|
4754
|
+
save: (params: {
|
|
4755
|
+
threadId: string;
|
|
4756
|
+
} & SaveConversationParams, options?: RequestOptions$2) => Observable<Conversation>;
|
|
4757
|
+
/**
|
|
4758
|
+
* Record the classification your own model produced for one thread:
|
|
4759
|
+
* exactly one of `coreMetrics` (a verdict) or `classificationError`
|
|
4760
|
+
* (why classification failed).
|
|
4761
|
+
*/
|
|
4762
|
+
classify: (params: {
|
|
4763
|
+
threadId: string;
|
|
4764
|
+
} & ClassifyConversationParams, options?: RequestOptions$2) => Observable<Conversation>;
|
|
4765
|
+
/**
|
|
4766
|
+
* One recorded conversation by its thread id, or `null` when the thread
|
|
4767
|
+
* was never recorded. Runs:
|
|
4768
|
+
*
|
|
4769
|
+
* `*[_type == "sanity.context.conversation" && organizationId == $org && threadId == $threadId][0]`
|
|
4770
|
+
*
|
|
4771
|
+
* For anything more, use {@link fetch}.
|
|
4772
|
+
*/
|
|
4773
|
+
get: (params: {
|
|
4774
|
+
threadId: string;
|
|
4775
|
+
}, options?: ContextRequestOptions) => Observable<ConversationDoc | null>;
|
|
4776
|
+
};
|
|
1633
4777
|
/**
|
|
1634
|
-
*
|
|
1635
|
-
*
|
|
1636
|
-
*
|
|
1637
|
-
*
|
|
1638
|
-
* @param query - GROQ-filter to listen to changes for
|
|
1639
|
-
* @param params - Optional query parameters
|
|
1640
|
-
* @param options - The same listener options `client.listen` takes, forwarded
|
|
1641
|
-
* to the organization store's listener
|
|
4778
|
+
* Entries: the built outline, one entry per node. Reads are canned GROQ
|
|
4779
|
+
* queries against the organization's document store; for anything more,
|
|
4780
|
+
* use {@link fetch}. Requires `context.organizationId` alongside the
|
|
4781
|
+
* knowledge-base `resource` in the client configuration.
|
|
1642
4782
|
*/
|
|
1643
|
-
|
|
4783
|
+
entries: {
|
|
4784
|
+
/**
|
|
4785
|
+
* Every entry, path-ordered, as a metadata view (`_id`, `path`,
|
|
4786
|
+
* `title`, `tldr`, `status`) with bodies excluded. Drains keyset pages
|
|
4787
|
+
* internally and emits the complete set. Runs:
|
|
4788
|
+
*
|
|
4789
|
+
* `*[_type == "sanity.context.entry" && knowledgeBaseId == $kb && path > $after] | order(path asc) [0...200] {_id, path, title, tldr, status}`
|
|
4790
|
+
*
|
|
4791
|
+
* For bodies, use `entries.get` or {@link fetch}.
|
|
4792
|
+
*/
|
|
4793
|
+
list: (options?: ContextRequestOptions) => Observable<Entry[]>;
|
|
4794
|
+
/**
|
|
4795
|
+
* One entry with its full body and citations, by outline path (e.g.
|
|
4796
|
+
* `billing/refunds`), or `null` when no entry sits at that path. Runs:
|
|
4797
|
+
*
|
|
4798
|
+
* `*[_type == "sanity.context.entry" && knowledgeBaseId == $kb && path == $path][0]`
|
|
4799
|
+
*
|
|
4800
|
+
* For anything more, use {@link fetch}.
|
|
4801
|
+
*/
|
|
4802
|
+
get: (params: {
|
|
4803
|
+
path: string;
|
|
4804
|
+
}, options?: ContextRequestOptions) => Observable<EntryDoc | null>;
|
|
4805
|
+
/**
|
|
4806
|
+
* Rebuild one entry from its already-placed sources, by outline path.
|
|
4807
|
+
* Poll the returned job with the promise client's `jobs`;
|
|
4808
|
+
* `affectedEntries` lists every entry the rebuild touches.
|
|
4809
|
+
*/
|
|
4810
|
+
rebuild: (params: {
|
|
4811
|
+
path: string;
|
|
4812
|
+
}, options?: RequestOptions$2) => Observable<RebuildEntryResponse>;
|
|
4813
|
+
};
|
|
4814
|
+
/**
|
|
4815
|
+
* Issues: findings from builds awaiting triage. Reads are canned GROQ
|
|
4816
|
+
* queries against the organization's document store; for anything more,
|
|
4817
|
+
* use {@link fetch}. Requires `context.organizationId` alongside the
|
|
4818
|
+
* knowledge-base `resource` in the client configuration.
|
|
4819
|
+
*/
|
|
4820
|
+
issues: {
|
|
4821
|
+
/**
|
|
4822
|
+
* Every issue on the knowledge base, oldest first, optionally narrowed
|
|
4823
|
+
* to one status. Drains keyset pages internally and emits the complete
|
|
4824
|
+
* set. Runs:
|
|
4825
|
+
*
|
|
4826
|
+
* `*[_type == "sanity.context.issue" && knowledgeBaseId == $kb && status == $status] | order(_createdAt asc, _id asc)`
|
|
4827
|
+
*
|
|
4828
|
+
* (the status clause only when given). For anything more, use {@link fetch}.
|
|
4829
|
+
*/
|
|
4830
|
+
list: (params?: {
|
|
4831
|
+
status?: 'open' | 'accepted' | 'rejected';
|
|
4832
|
+
}, options?: ContextRequestOptions) => Observable<IssueDoc[]>;
|
|
4833
|
+
/**
|
|
4834
|
+
* One issue by its document id, or `null` when it does not exist. Runs:
|
|
4835
|
+
*
|
|
4836
|
+
* `*[_type == "sanity.context.issue" && knowledgeBaseId == $kb && _id == $id][0]`
|
|
4837
|
+
*
|
|
4838
|
+
* For anything more, use {@link fetch}.
|
|
4839
|
+
*/
|
|
4840
|
+
get: (params: {
|
|
4841
|
+
issueId: string;
|
|
4842
|
+
}, options?: ContextRequestOptions) => Observable<IssueDoc | null>;
|
|
4843
|
+
};
|
|
4844
|
+
/**
|
|
4845
|
+
* Instructions: standing decisions that steer every build. The canned
|
|
4846
|
+
* GROQ read; writes are promise-based on `client.context`.
|
|
4847
|
+
*/
|
|
4848
|
+
instructions: {
|
|
4849
|
+
/**
|
|
4850
|
+
* Every current-schema instruction on the knowledge base, oldest first.
|
|
4851
|
+
* Drains keyset pages internally and emits the complete set. Runs:
|
|
4852
|
+
*
|
|
4853
|
+
* `*[_type == "sanity.context.instruction" && knowledgeBaseId == $kb && schemaVersion == 1] | order(_createdAt asc, _id asc)`
|
|
4854
|
+
*
|
|
4855
|
+
* For anything more, use {@link fetch}. Requires `context.organizationId`
|
|
4856
|
+
* alongside the knowledge-base `resource` in the client configuration.
|
|
4857
|
+
*/
|
|
4858
|
+
list: (options?: ContextRequestOptions) => Observable<InstructionDoc[]>;
|
|
4859
|
+
};
|
|
4860
|
+
/**
|
|
4861
|
+
* MCP endpoint configurations, org-owned documents read with canned GROQ
|
|
4862
|
+
* queries. Requires `context.organizationId` in the client configuration.
|
|
4863
|
+
*/
|
|
4864
|
+
mcpEndpoints: {
|
|
4865
|
+
/**
|
|
4866
|
+
* The organization's MCP endpoint configurations, oldest first. Runs:
|
|
4867
|
+
*
|
|
4868
|
+
* `*[_type == "sanity.context.mcp" && organizationId == $org] | order(_createdAt asc, _id asc) [0...500]`
|
|
4869
|
+
*
|
|
4870
|
+
* For anything more, use {@link fetch}.
|
|
4871
|
+
*/
|
|
4872
|
+
list: (options?: ContextRequestOptions) => Observable<McpDoc[]>;
|
|
4873
|
+
/**
|
|
4874
|
+
* One MCP endpoint configuration by its URL name, or `null` when none
|
|
4875
|
+
* carries that name. Runs:
|
|
4876
|
+
*
|
|
4877
|
+
* `*[_type == "sanity.context.mcp" && organizationId == $org && name == $name][0]`
|
|
4878
|
+
*
|
|
4879
|
+
* For anything more, use {@link fetch}.
|
|
4880
|
+
*/
|
|
4881
|
+
get: (params: {
|
|
4882
|
+
name: string;
|
|
4883
|
+
}, options?: ContextRequestOptions) => Observable<McpDoc | null>;
|
|
4884
|
+
};
|
|
1644
4885
|
}
|
|
1645
4886
|
/**
|
|
1646
4887
|
* @public
|
|
4888
|
+
* @inline
|
|
1647
4889
|
*/
|
|
1648
4890
|
declare class LiveClient {
|
|
1649
4891
|
#private;
|
|
@@ -2021,7 +5263,10 @@ declare class ObservableTransaction extends BaseTransaction {
|
|
|
2021
5263
|
*/
|
|
2022
5264
|
patch(patch: ObservablePatch): this;
|
|
2023
5265
|
}
|
|
2024
|
-
/**
|
|
5266
|
+
/**
|
|
5267
|
+
* @internal
|
|
5268
|
+
* @inline
|
|
5269
|
+
*/
|
|
2025
5270
|
declare class ObservableDatasetsClient {
|
|
2026
5271
|
#private;
|
|
2027
5272
|
constructor(client: ObservableSanityClient$1, httpRequest: HttpRequest);
|
|
@@ -2065,7 +5310,10 @@ declare class ObservableDatasetsClient {
|
|
|
2065
5310
|
*/
|
|
2066
5311
|
editEmbeddingsSettings(name: string, settings: EmbeddingsSettingsBody): Observable<void>;
|
|
2067
5312
|
}
|
|
2068
|
-
/**
|
|
5313
|
+
/**
|
|
5314
|
+
* @internal
|
|
5315
|
+
* @inline
|
|
5316
|
+
*/
|
|
2069
5317
|
declare class DatasetsClient {
|
|
2070
5318
|
#private;
|
|
2071
5319
|
constructor(client: SanityClient$1, httpRequest: HttpRequest);
|
|
@@ -2205,7 +5453,10 @@ declare class FunctionsClient {
|
|
|
2205
5453
|
}): Promise<R>;
|
|
2206
5454
|
invoke<R = unknown>(functionName: string, request?: InvokeFunctionRequest, options?: InvokeFunctionOptions): Promise<R | undefined>;
|
|
2207
5455
|
}
|
|
2208
|
-
/**
|
|
5456
|
+
/**
|
|
5457
|
+
* @internal
|
|
5458
|
+
* @inline
|
|
5459
|
+
*/
|
|
2209
5460
|
declare class ObservableMediaLibraryVideoClient {
|
|
2210
5461
|
#private;
|
|
2211
5462
|
constructor(client: ObservableSanityClient$1, httpRequest: HttpRequest);
|
|
@@ -2217,7 +5468,10 @@ declare class ObservableMediaLibraryVideoClient {
|
|
|
2217
5468
|
*/
|
|
2218
5469
|
getPlaybackInfo(assetIdentifier: MediaLibraryAssetInstanceIdentifier, options?: MediaLibraryPlaybackInfoOptions): Observable<VideoPlaybackInfo>;
|
|
2219
5470
|
}
|
|
2220
|
-
/**
|
|
5471
|
+
/**
|
|
5472
|
+
* @internal
|
|
5473
|
+
* @inline
|
|
5474
|
+
*/
|
|
2221
5475
|
declare class MediaLibraryVideoClient {
|
|
2222
5476
|
#private;
|
|
2223
5477
|
constructor(client: SanityClient$1, httpRequest: HttpRequest);
|
|
@@ -2240,7 +5494,10 @@ type OmittedProjectFields<T extends ListOptions | undefined> = (T extends {
|
|
|
2240
5494
|
} ? 'members' : never) | (T extends {
|
|
2241
5495
|
includeFeatures: false;
|
|
2242
5496
|
} ? 'features' : never);
|
|
2243
|
-
/**
|
|
5497
|
+
/**
|
|
5498
|
+
* @internal
|
|
5499
|
+
* @inline
|
|
5500
|
+
*/
|
|
2244
5501
|
declare class ObservableProjectsClient {
|
|
2245
5502
|
#private;
|
|
2246
5503
|
constructor(client: ObservableSanityClient$1, httpRequest: HttpRequest);
|
|
@@ -2261,7 +5518,10 @@ declare class ObservableProjectsClient {
|
|
|
2261
5518
|
*/
|
|
2262
5519
|
getById(projectId: string): Observable<SanityProject>;
|
|
2263
5520
|
}
|
|
2264
|
-
/**
|
|
5521
|
+
/**
|
|
5522
|
+
* @internal
|
|
5523
|
+
* @inline
|
|
5524
|
+
*/
|
|
2265
5525
|
declare class ProjectsClient {
|
|
2266
5526
|
#private;
|
|
2267
5527
|
constructor(client: SanityClient$1, httpRequest: HttpRequest);
|
|
@@ -2282,7 +5542,10 @@ declare class ProjectsClient {
|
|
|
2282
5542
|
*/
|
|
2283
5543
|
getById(projectId: string): Promise<SanityProject>;
|
|
2284
5544
|
}
|
|
2285
|
-
/**
|
|
5545
|
+
/**
|
|
5546
|
+
* @public
|
|
5547
|
+
* @inline
|
|
5548
|
+
*/
|
|
2286
5549
|
declare class ObservableReleasesClient {
|
|
2287
5550
|
#private;
|
|
2288
5551
|
constructor(client: ObservableSanityClient$1, httpRequest: HttpRequest);
|
|
@@ -2527,7 +5790,10 @@ declare class ObservableReleasesClient {
|
|
|
2527
5790
|
releaseId: string;
|
|
2528
5791
|
}, options?: BaseMutationOptions): Observable<RawQueryResponse$1<SanityDocument$1[]>>;
|
|
2529
5792
|
}
|
|
2530
|
-
/**
|
|
5793
|
+
/**
|
|
5794
|
+
* @public
|
|
5795
|
+
* @inline
|
|
5796
|
+
*/
|
|
2531
5797
|
declare class ReleasesClient {
|
|
2532
5798
|
#private;
|
|
2533
5799
|
constructor(client: SanityClient$1, httpRequest: HttpRequest);
|
|
@@ -2763,7 +6029,10 @@ declare class ReleasesClient {
|
|
|
2763
6029
|
releaseId: string;
|
|
2764
6030
|
}, options?: BaseMutationOptions): Promise<RawQueryResponse$1<SanityDocument$1[]>>;
|
|
2765
6031
|
}
|
|
2766
|
-
/**
|
|
6032
|
+
/**
|
|
6033
|
+
* @public
|
|
6034
|
+
* @inline
|
|
6035
|
+
*/
|
|
2767
6036
|
declare class ObservableUsersClient {
|
|
2768
6037
|
#private;
|
|
2769
6038
|
constructor(client: ObservableSanityClient$1, httpRequest: HttpRequest);
|
|
@@ -2774,7 +6043,10 @@ declare class ObservableUsersClient {
|
|
|
2774
6043
|
*/
|
|
2775
6044
|
getById<T extends string>(id: T): Observable<T extends 'me' ? CurrentSanityUser : SanityUser>;
|
|
2776
6045
|
}
|
|
2777
|
-
/**
|
|
6046
|
+
/**
|
|
6047
|
+
* @public
|
|
6048
|
+
* @inline
|
|
6049
|
+
*/
|
|
2778
6050
|
declare class UsersClient {
|
|
2779
6051
|
#private;
|
|
2780
6052
|
constructor(client: SanityClient$1, httpRequest: HttpRequest);
|
|
@@ -2788,15 +6060,52 @@ declare class UsersClient {
|
|
|
2788
6060
|
/** @public */
|
|
2789
6061
|
declare class ObservableSanityClient$1 {
|
|
2790
6062
|
#private;
|
|
6063
|
+
/**
|
|
6064
|
+
* Upload, fetch and delete assets (images and files) in the configured dataset
|
|
6065
|
+
*
|
|
6066
|
+
* @category Assets
|
|
6067
|
+
*/
|
|
2791
6068
|
assets: ObservableAssetsClient;
|
|
6069
|
+
/**
|
|
6070
|
+
* Create, list, edit and delete datasets in the configured project
|
|
6071
|
+
*
|
|
6072
|
+
* @category Projects & Datasets
|
|
6073
|
+
*/
|
|
2792
6074
|
datasets: ObservableDatasetsClient;
|
|
6075
|
+
/**
|
|
6076
|
+
* Subscribe to live content updates through the Live Content API
|
|
6077
|
+
*
|
|
6078
|
+
* @category Real-time
|
|
6079
|
+
*/
|
|
2793
6080
|
live: LiveClient;
|
|
6081
|
+
/**
|
|
6082
|
+
* Interact with Media Library assets
|
|
6083
|
+
*
|
|
6084
|
+
* @category Assets
|
|
6085
|
+
*/
|
|
2794
6086
|
mediaLibrary: {
|
|
6087
|
+
/** Upload and manage Media Library video assets */
|
|
2795
6088
|
video: ObservableMediaLibraryVideoClient;
|
|
2796
6089
|
};
|
|
6090
|
+
/**
|
|
6091
|
+
* Fetch information about the projects the authenticated user has access to
|
|
6092
|
+
*
|
|
6093
|
+
* @category Projects & Datasets
|
|
6094
|
+
*/
|
|
2797
6095
|
projects: ObservableProjectsClient;
|
|
6096
|
+
/**
|
|
6097
|
+
* Fetch information about users in the configured project
|
|
6098
|
+
*
|
|
6099
|
+
* @category Projects & Datasets
|
|
6100
|
+
*/
|
|
2798
6101
|
users: ObservableUsersClient;
|
|
6102
|
+
/**
|
|
6103
|
+
* Run Agent Actions - AI-powered operations to generate, transform, translate, prompt and patch documents
|
|
6104
|
+
*
|
|
6105
|
+
* @category Agent Actions
|
|
6106
|
+
*/
|
|
2799
6107
|
agent: {
|
|
6108
|
+
/** Run individual Agent Action operations */
|
|
2800
6109
|
action: ObservableAgentsActionClient;
|
|
2801
6110
|
};
|
|
2802
6111
|
collaboration: {
|
|
@@ -2804,18 +6113,31 @@ declare class ObservableSanityClient$1 {
|
|
|
2804
6113
|
comments: ObservableCollaborationCommentsClient;
|
|
2805
6114
|
};
|
|
2806
6115
|
functions: ObservableFunctionsClient;
|
|
6116
|
+
/**
|
|
6117
|
+
* Create and manage content releases and their scheduled publishing
|
|
6118
|
+
*
|
|
6119
|
+
* @category Releases
|
|
6120
|
+
*/
|
|
2807
6121
|
releases: ObservableReleasesClient;
|
|
6122
|
+
/** @beta */
|
|
6123
|
+
context: ObservableContextClient;
|
|
2808
6124
|
/**
|
|
2809
|
-
*
|
|
6125
|
+
* Listen to document changes matching a GROQ query, delivered as server-sent events
|
|
6126
|
+
*
|
|
6127
|
+
* @category Real-time
|
|
2810
6128
|
*/
|
|
2811
6129
|
listen: typeof _listen;
|
|
2812
6130
|
constructor(httpRequest: HttpRequest, config?: ClientConfig$1);
|
|
2813
6131
|
/**
|
|
2814
6132
|
* Clone the client - returns a new instance
|
|
6133
|
+
*
|
|
6134
|
+
* @category Configuration
|
|
2815
6135
|
*/
|
|
2816
6136
|
clone(): ObservableSanityClient$1;
|
|
2817
6137
|
/**
|
|
2818
6138
|
* Returns the current client configuration
|
|
6139
|
+
*
|
|
6140
|
+
* @category Configuration
|
|
2819
6141
|
*/
|
|
2820
6142
|
config(): InitializedClientConfig$1;
|
|
2821
6143
|
/**
|
|
@@ -2825,12 +6147,16 @@ declare class ObservableSanityClient$1 {
|
|
|
2825
6147
|
/**
|
|
2826
6148
|
* Clone the client with a new (partial) configuration.
|
|
2827
6149
|
*
|
|
6150
|
+
* @category Configuration
|
|
6151
|
+
*
|
|
2828
6152
|
* @param newConfig - New client configuration properties, shallowly merged with existing configuration
|
|
2829
6153
|
*/
|
|
2830
6154
|
withConfig(newConfig?: Partial<ClientConfig$1>): ObservableSanityClient$1;
|
|
2831
6155
|
/**
|
|
2832
6156
|
* Perform a GROQ-query against the configured dataset.
|
|
2833
6157
|
*
|
|
6158
|
+
* @category Querying
|
|
6159
|
+
*
|
|
2834
6160
|
* @param query - GROQ-query to perform
|
|
2835
6161
|
*/
|
|
2836
6162
|
fetch<R = Any$1, Q extends QueryWithoutParams = QueryWithoutParams, const G extends string = string>(query: G, params?: Q | QueryWithoutParams): Observable<ClientReturn$1<G, R>>;
|
|
@@ -2861,6 +6187,8 @@ declare class ObservableSanityClient$1 {
|
|
|
2861
6187
|
/**
|
|
2862
6188
|
* Fetch a single document with the given ID.
|
|
2863
6189
|
*
|
|
6190
|
+
* @category Querying
|
|
6191
|
+
*
|
|
2864
6192
|
* @param id - Document ID to fetch
|
|
2865
6193
|
* @param options - Request options
|
|
2866
6194
|
*/
|
|
@@ -2888,6 +6216,8 @@ declare class ObservableSanityClient$1 {
|
|
|
2888
6216
|
* The order/position of documents is preserved based on the original array of IDs.
|
|
2889
6217
|
* If any of the documents are missing, they will be replaced by a `null` entry in the returned array
|
|
2890
6218
|
*
|
|
6219
|
+
* @category Querying
|
|
6220
|
+
*
|
|
2891
6221
|
* @param ids - Document IDs to fetch
|
|
2892
6222
|
* @param options - Request options
|
|
2893
6223
|
*/
|
|
@@ -2898,6 +6228,8 @@ declare class ObservableSanityClient$1 {
|
|
|
2898
6228
|
* Convenient and bandwidth efficient method of checking wether a set of document IDs exists.
|
|
2899
6229
|
* Returns a set of the IDs that exist.
|
|
2900
6230
|
*
|
|
6231
|
+
* @category Querying
|
|
6232
|
+
*
|
|
2901
6233
|
* @param ids - Document IDs to check
|
|
2902
6234
|
* @param options - Request options
|
|
2903
6235
|
*/
|
|
@@ -2909,6 +6241,8 @@ declare class ObservableSanityClient$1 {
|
|
|
2909
6241
|
* Create a document. Requires a `_type` property. If no `_id` is provided, it will be generated by the database.
|
|
2910
6242
|
* Returns an observable that resolves to the created document.
|
|
2911
6243
|
*
|
|
6244
|
+
* @category Mutations
|
|
6245
|
+
*
|
|
2912
6246
|
* @param document - Document to create
|
|
2913
6247
|
* @param options - Mutation options
|
|
2914
6248
|
*/
|
|
@@ -2949,6 +6283,8 @@ declare class ObservableSanityClient$1 {
|
|
|
2949
6283
|
* Create a document if no document with the same ID already exists.
|
|
2950
6284
|
* Returns an observable that resolves to the created document.
|
|
2951
6285
|
*
|
|
6286
|
+
* @category Mutations
|
|
6287
|
+
*
|
|
2952
6288
|
* @param document - Document to create
|
|
2953
6289
|
* @param options - Mutation options
|
|
2954
6290
|
*/
|
|
@@ -2989,6 +6325,8 @@ declare class ObservableSanityClient$1 {
|
|
|
2989
6325
|
* Create a document if it does not exist, or replace a document with the same document ID
|
|
2990
6326
|
* Returns an observable that resolves to the created document.
|
|
2991
6327
|
*
|
|
6328
|
+
* @category Mutations
|
|
6329
|
+
*
|
|
2992
6330
|
* @param document - Document to either create or replace
|
|
2993
6331
|
* @param options - Mutation options
|
|
2994
6332
|
*/
|
|
@@ -3113,6 +6451,8 @@ declare class ObservableSanityClient$1 {
|
|
|
3113
6451
|
* Deletes a document with the given document ID.
|
|
3114
6452
|
* Returns an observable that resolves to the deleted document.
|
|
3115
6453
|
*
|
|
6454
|
+
* @category Mutations
|
|
6455
|
+
*
|
|
3116
6456
|
* @param id - Document ID to delete
|
|
3117
6457
|
* @param options - Options for the mutation
|
|
3118
6458
|
*/
|
|
@@ -3198,6 +6538,8 @@ declare class ObservableSanityClient$1 {
|
|
|
3198
6538
|
* * Discarding a version with no `releaseId` will discard the draft version of the published document.
|
|
3199
6539
|
* * If the draft or release version does not exist, any error will throw.
|
|
3200
6540
|
*
|
|
6541
|
+
* @category Versions
|
|
6542
|
+
*
|
|
3201
6543
|
* @param params - Version action parameters:
|
|
3202
6544
|
* - `releaseId` - The ID of the release to discard the document from.
|
|
3203
6545
|
* - `publishedId` - The published ID of the document to discard.
|
|
@@ -3233,6 +6575,8 @@ declare class ObservableSanityClient$1 {
|
|
|
3233
6575
|
* * Replacing a version with no `releaseId` will replace the draft version of the published document.
|
|
3234
6576
|
* * At least one of the **version** or **published** documents must exist.
|
|
3235
6577
|
*
|
|
6578
|
+
* @category Versions
|
|
6579
|
+
*
|
|
3236
6580
|
* @param params - Version action parameters:
|
|
3237
6581
|
* - `document` - The new document to replace the version with.
|
|
3238
6582
|
* - `releaseId` - The ID of the release where the document version is replaced.
|
|
@@ -3305,6 +6649,8 @@ declare class ObservableSanityClient$1 {
|
|
|
3305
6649
|
* @remarks
|
|
3306
6650
|
* * If the published document does not exist, an error will be thrown.
|
|
3307
6651
|
*
|
|
6652
|
+
* @category Versions
|
|
6653
|
+
*
|
|
3308
6654
|
* @param params - Version action parameters:
|
|
3309
6655
|
* - `releaseId` - The ID of the release to unpublish the document from.
|
|
3310
6656
|
* - `publishedId` - The published ID of the document to unpublish.
|
|
@@ -3325,6 +6671,8 @@ declare class ObservableSanityClient$1 {
|
|
|
3325
6671
|
* Perform mutation operations against the configured dataset
|
|
3326
6672
|
* Returns an observable that resolves to the first mutated document.
|
|
3327
6673
|
*
|
|
6674
|
+
* @category Mutations
|
|
6675
|
+
*
|
|
3328
6676
|
* @param operations - Mutation operations to execute
|
|
3329
6677
|
* @param options - Mutation options
|
|
3330
6678
|
*/
|
|
@@ -3364,6 +6712,8 @@ declare class ObservableSanityClient$1 {
|
|
|
3364
6712
|
/**
|
|
3365
6713
|
* Create a new buildable patch of operations to perform
|
|
3366
6714
|
*
|
|
6715
|
+
* @category Mutations
|
|
6716
|
+
*
|
|
3367
6717
|
* @param documentId - Document ID to patch
|
|
3368
6718
|
* @param operations - Optional object of patch operations to initialize the patch instance with
|
|
3369
6719
|
* @returns Patch instance - call `.commit()` to perform the operations defined
|
|
@@ -3388,12 +6738,16 @@ declare class ObservableSanityClient$1 {
|
|
|
3388
6738
|
/**
|
|
3389
6739
|
* Create a new transaction of mutations
|
|
3390
6740
|
*
|
|
6741
|
+
* @category Mutations
|
|
6742
|
+
*
|
|
3391
6743
|
* @param operations - Optional array of mutation operations to initialize the transaction instance with
|
|
3392
6744
|
*/
|
|
3393
6745
|
transaction<R extends Record<string, Any$1> = Record<string, Any$1>>(operations?: Mutation<R>[]): ObservableTransaction;
|
|
3394
6746
|
/**
|
|
3395
6747
|
* Perform action operations against the configured dataset
|
|
3396
6748
|
*
|
|
6749
|
+
* @category Mutations
|
|
6750
|
+
*
|
|
3397
6751
|
* @param operations - Action operation(s) to execute
|
|
3398
6752
|
* @param options - Action options
|
|
3399
6753
|
*/
|
|
@@ -3401,12 +6755,16 @@ declare class ObservableSanityClient$1 {
|
|
|
3401
6755
|
/**
|
|
3402
6756
|
* Perform an HTTP request against the Sanity API
|
|
3403
6757
|
*
|
|
6758
|
+
* @category HTTP
|
|
6759
|
+
*
|
|
3404
6760
|
* @param options - Request options
|
|
3405
6761
|
*/
|
|
3406
6762
|
request<R = Any$1>(options: RawRequestOptions): Observable<R>;
|
|
3407
6763
|
/**
|
|
3408
6764
|
* Get a Sanity API URL for the URI provided
|
|
3409
6765
|
*
|
|
6766
|
+
* @category HTTP
|
|
6767
|
+
*
|
|
3410
6768
|
* @param uri - URI/path to build URL for
|
|
3411
6769
|
* @param canUseCdn - Whether or not to allow using the API CDN for this route
|
|
3412
6770
|
*/
|
|
@@ -3414,6 +6772,8 @@ declare class ObservableSanityClient$1 {
|
|
|
3414
6772
|
/**
|
|
3415
6773
|
* Get a Sanity API URL for the data operation and path provided
|
|
3416
6774
|
*
|
|
6775
|
+
* @category HTTP
|
|
6776
|
+
*
|
|
3417
6777
|
* @param operation - Data operation (eg `query`, `mutate`, `listen` or similar)
|
|
3418
6778
|
* @param path - Path to append after the operation
|
|
3419
6779
|
*/
|
|
@@ -3422,15 +6782,52 @@ declare class ObservableSanityClient$1 {
|
|
|
3422
6782
|
/** @public */
|
|
3423
6783
|
declare class SanityClient$1 {
|
|
3424
6784
|
#private;
|
|
6785
|
+
/**
|
|
6786
|
+
* Upload, fetch and delete assets (images and files) in the configured dataset
|
|
6787
|
+
*
|
|
6788
|
+
* @category Assets
|
|
6789
|
+
*/
|
|
3425
6790
|
assets: AssetsClient;
|
|
6791
|
+
/**
|
|
6792
|
+
* Create, list, edit and delete datasets in the configured project
|
|
6793
|
+
*
|
|
6794
|
+
* @category Projects & Datasets
|
|
6795
|
+
*/
|
|
3426
6796
|
datasets: DatasetsClient;
|
|
6797
|
+
/**
|
|
6798
|
+
* Subscribe to live content updates through the Live Content API
|
|
6799
|
+
*
|
|
6800
|
+
* @category Real-time
|
|
6801
|
+
*/
|
|
3427
6802
|
live: LiveClient;
|
|
6803
|
+
/**
|
|
6804
|
+
* Interact with Media Library assets
|
|
6805
|
+
*
|
|
6806
|
+
* @category Assets
|
|
6807
|
+
*/
|
|
3428
6808
|
mediaLibrary: {
|
|
6809
|
+
/** Upload and manage Media Library video assets */
|
|
3429
6810
|
video: MediaLibraryVideoClient;
|
|
3430
6811
|
};
|
|
6812
|
+
/**
|
|
6813
|
+
* Fetch information about the projects the authenticated user has access to
|
|
6814
|
+
*
|
|
6815
|
+
* @category Projects & Datasets
|
|
6816
|
+
*/
|
|
3431
6817
|
projects: ProjectsClient;
|
|
6818
|
+
/**
|
|
6819
|
+
* Fetch information about users in the configured project
|
|
6820
|
+
*
|
|
6821
|
+
* @category Projects & Datasets
|
|
6822
|
+
*/
|
|
3432
6823
|
users: UsersClient;
|
|
6824
|
+
/**
|
|
6825
|
+
* Run Agent Actions - AI-powered operations to generate, transform, translate, prompt and patch documents
|
|
6826
|
+
*
|
|
6827
|
+
* @category Agent Actions
|
|
6828
|
+
*/
|
|
3433
6829
|
agent: {
|
|
6830
|
+
/** Run individual Agent Action operations */
|
|
3434
6831
|
action: AgentActionsClient;
|
|
3435
6832
|
};
|
|
3436
6833
|
collaboration: {
|
|
@@ -3438,22 +6835,37 @@ declare class SanityClient$1 {
|
|
|
3438
6835
|
comments: CollaborationCommentsClient;
|
|
3439
6836
|
};
|
|
3440
6837
|
functions: FunctionsClient;
|
|
6838
|
+
/**
|
|
6839
|
+
* Create and manage content releases and their scheduled publishing
|
|
6840
|
+
*
|
|
6841
|
+
* @category Releases
|
|
6842
|
+
*/
|
|
3441
6843
|
releases: ReleasesClient;
|
|
6844
|
+
/** @beta */
|
|
6845
|
+
context: ContextClient;
|
|
3442
6846
|
/**
|
|
3443
6847
|
* Observable version of the Sanity client, with the same configuration as the promise-based one
|
|
6848
|
+
*
|
|
6849
|
+
* @category Configuration
|
|
3444
6850
|
*/
|
|
3445
6851
|
observable: ObservableSanityClient$1;
|
|
3446
6852
|
/**
|
|
3447
|
-
*
|
|
6853
|
+
* Listen to document changes matching a GROQ query, delivered as server-sent events
|
|
6854
|
+
*
|
|
6855
|
+
* @category Real-time
|
|
3448
6856
|
*/
|
|
3449
6857
|
listen: typeof _listen;
|
|
3450
6858
|
constructor(httpRequest: HttpRequest, config?: ClientConfig$1);
|
|
3451
6859
|
/**
|
|
3452
6860
|
* Clone the client - returns a new instance
|
|
6861
|
+
*
|
|
6862
|
+
* @category Configuration
|
|
3453
6863
|
*/
|
|
3454
6864
|
clone(): SanityClient$1;
|
|
3455
6865
|
/**
|
|
3456
6866
|
* Returns the current client configuration
|
|
6867
|
+
*
|
|
6868
|
+
* @category Configuration
|
|
3457
6869
|
*/
|
|
3458
6870
|
config(): InitializedClientConfig$1;
|
|
3459
6871
|
/**
|
|
@@ -3463,12 +6875,16 @@ declare class SanityClient$1 {
|
|
|
3463
6875
|
/**
|
|
3464
6876
|
* Clone the client with a new (partial) configuration.
|
|
3465
6877
|
*
|
|
6878
|
+
* @category Configuration
|
|
6879
|
+
*
|
|
3466
6880
|
* @param newConfig - New client configuration properties, shallowly merged with existing configuration
|
|
3467
6881
|
*/
|
|
3468
6882
|
withConfig(newConfig?: Partial<ClientConfig$1>): SanityClient$1;
|
|
3469
6883
|
/**
|
|
3470
6884
|
* Perform a GROQ-query against the configured dataset.
|
|
3471
6885
|
*
|
|
6886
|
+
* @category Querying
|
|
6887
|
+
*
|
|
3472
6888
|
* @param query - GROQ-query to perform
|
|
3473
6889
|
*/
|
|
3474
6890
|
fetch<R = Any$1, Q extends QueryWithoutParams = QueryWithoutParams, const G extends string = string>(query: G, params?: Q | QueryWithoutParams): Promise<ClientReturn$1<G, R>>;
|
|
@@ -3499,6 +6915,8 @@ declare class SanityClient$1 {
|
|
|
3499
6915
|
/**
|
|
3500
6916
|
* Fetch a single document with the given ID.
|
|
3501
6917
|
*
|
|
6918
|
+
* @category Querying
|
|
6919
|
+
*
|
|
3502
6920
|
* @param id - Document ID to fetch
|
|
3503
6921
|
* @param options - Request options
|
|
3504
6922
|
*/
|
|
@@ -3526,6 +6944,8 @@ declare class SanityClient$1 {
|
|
|
3526
6944
|
* The order/position of documents is preserved based on the original array of IDs.
|
|
3527
6945
|
* If any of the documents are missing, they will be replaced by a `null` entry in the returned array
|
|
3528
6946
|
*
|
|
6947
|
+
* @category Querying
|
|
6948
|
+
*
|
|
3529
6949
|
* @param ids - Document IDs to fetch
|
|
3530
6950
|
* @param options - Request options
|
|
3531
6951
|
*/
|
|
@@ -3537,6 +6957,8 @@ declare class SanityClient$1 {
|
|
|
3537
6957
|
* Convenient and bandwidth efficient method of checking wether a set of document IDs exists.
|
|
3538
6958
|
* Returns a set of the IDs that exist.
|
|
3539
6959
|
*
|
|
6960
|
+
* @category Querying
|
|
6961
|
+
*
|
|
3540
6962
|
* @param ids - Document IDs to check
|
|
3541
6963
|
* @param options - Request options
|
|
3542
6964
|
*/
|
|
@@ -3548,6 +6970,8 @@ declare class SanityClient$1 {
|
|
|
3548
6970
|
* Create a document. Requires a `_type` property. If no `_id` is provided, it will be generated by the database.
|
|
3549
6971
|
* Returns a promise that resolves to the created document.
|
|
3550
6972
|
*
|
|
6973
|
+
* @category Mutations
|
|
6974
|
+
*
|
|
3551
6975
|
* @param document - Document to create
|
|
3552
6976
|
* @param options - Mutation options
|
|
3553
6977
|
*/
|
|
@@ -3588,6 +7012,8 @@ declare class SanityClient$1 {
|
|
|
3588
7012
|
* Create a document if no document with the same ID already exists.
|
|
3589
7013
|
* Returns a promise that resolves to the created document.
|
|
3590
7014
|
*
|
|
7015
|
+
* @category Mutations
|
|
7016
|
+
*
|
|
3591
7017
|
* @param document - Document to create
|
|
3592
7018
|
* @param options - Mutation options
|
|
3593
7019
|
*/
|
|
@@ -3628,6 +7054,8 @@ declare class SanityClient$1 {
|
|
|
3628
7054
|
* Create a document if it does not exist, or replace a document with the same document ID
|
|
3629
7055
|
* Returns a promise that resolves to the created document.
|
|
3630
7056
|
*
|
|
7057
|
+
* @category Mutations
|
|
7058
|
+
*
|
|
3631
7059
|
* @param document - Document to either create or replace
|
|
3632
7060
|
* @param options - Mutation options
|
|
3633
7061
|
*/
|
|
@@ -3740,6 +7168,8 @@ declare class SanityClient$1 {
|
|
|
3740
7168
|
* Deletes a document with the given document ID.
|
|
3741
7169
|
* Returns a promise that resolves to the deleted document.
|
|
3742
7170
|
*
|
|
7171
|
+
* @category Mutations
|
|
7172
|
+
*
|
|
3743
7173
|
* @param id - Document ID to delete
|
|
3744
7174
|
* @param options - Options for the mutation
|
|
3745
7175
|
*/
|
|
@@ -3825,6 +7255,8 @@ declare class SanityClient$1 {
|
|
|
3825
7255
|
* * Discarding a version with no `releaseId` will discard the draft version of the published document.
|
|
3826
7256
|
* * If the draft or release version does not exist, any error will throw.
|
|
3827
7257
|
*
|
|
7258
|
+
* @category Versions
|
|
7259
|
+
*
|
|
3828
7260
|
* @param params - Version action parameters:
|
|
3829
7261
|
* - `releaseId` - The ID of the release to discard the document from.
|
|
3830
7262
|
* - `publishedId` - The published ID of the document to discard.
|
|
@@ -3860,6 +7292,8 @@ declare class SanityClient$1 {
|
|
|
3860
7292
|
* * Replacing a version with no `releaseId` will replace the draft version of the published document.
|
|
3861
7293
|
* * At least one of the **version** or **published** documents must exist.
|
|
3862
7294
|
*
|
|
7295
|
+
* @category Versions
|
|
7296
|
+
*
|
|
3863
7297
|
* @param params - Version action parameters:
|
|
3864
7298
|
* - `document` - The new document to replace the version with.
|
|
3865
7299
|
* - `releaseId` - The ID of the release where the document version is replaced.
|
|
@@ -3932,6 +7366,8 @@ declare class SanityClient$1 {
|
|
|
3932
7366
|
* @remarks
|
|
3933
7367
|
* * If the published document does not exist, an error will be thrown.
|
|
3934
7368
|
*
|
|
7369
|
+
* @category Versions
|
|
7370
|
+
*
|
|
3935
7371
|
* @param params - Version action parameters:
|
|
3936
7372
|
* - `releaseId` - The ID of the release to unpublish the document from.
|
|
3937
7373
|
* - `publishedId` - The published ID of the document to unpublish.
|
|
@@ -3952,6 +7388,8 @@ declare class SanityClient$1 {
|
|
|
3952
7388
|
* Perform mutation operations against the configured dataset
|
|
3953
7389
|
* Returns a promise that resolves to the first mutated document.
|
|
3954
7390
|
*
|
|
7391
|
+
* @category Mutations
|
|
7392
|
+
*
|
|
3955
7393
|
* @param operations - Mutation operations to execute
|
|
3956
7394
|
* @param options - Mutation options
|
|
3957
7395
|
*/
|
|
@@ -3991,6 +7429,8 @@ declare class SanityClient$1 {
|
|
|
3991
7429
|
/**
|
|
3992
7430
|
* Create a new buildable patch of operations to perform
|
|
3993
7431
|
*
|
|
7432
|
+
* @category Mutations
|
|
7433
|
+
*
|
|
3994
7434
|
* @param documentId - Document ID to patch
|
|
3995
7435
|
* @param operations - Optional object of patch operations to initialize the patch instance with
|
|
3996
7436
|
* @returns Patch instance - call `.commit()` to perform the operations defined
|
|
@@ -4015,6 +7455,8 @@ declare class SanityClient$1 {
|
|
|
4015
7455
|
/**
|
|
4016
7456
|
* Create a new transaction of mutations
|
|
4017
7457
|
*
|
|
7458
|
+
* @category Mutations
|
|
7459
|
+
*
|
|
4018
7460
|
* @param operations - Optional array of mutation operations to initialize the transaction instance with
|
|
4019
7461
|
*/
|
|
4020
7462
|
transaction<R extends Record<string, Any$1> = Record<string, Any$1>>(operations?: Mutation<R>[]): Transaction;
|
|
@@ -4022,6 +7464,8 @@ declare class SanityClient$1 {
|
|
|
4022
7464
|
* Perform action operations against the configured dataset
|
|
4023
7465
|
* Returns a promise that resolves to the transaction result
|
|
4024
7466
|
*
|
|
7467
|
+
* @category Mutations
|
|
7468
|
+
*
|
|
4025
7469
|
* @param operations - Action operation(s) to execute
|
|
4026
7470
|
* @param options - Action options
|
|
4027
7471
|
*/
|
|
@@ -4030,6 +7474,8 @@ declare class SanityClient$1 {
|
|
|
4030
7474
|
* Perform a request against the Sanity API
|
|
4031
7475
|
* NOTE: Only use this for Sanity API endpoints, not for your own APIs!
|
|
4032
7476
|
*
|
|
7477
|
+
* @category HTTP
|
|
7478
|
+
*
|
|
4033
7479
|
* @param options - Request options
|
|
4034
7480
|
* @returns Promise resolving to the response body
|
|
4035
7481
|
*/
|
|
@@ -4048,6 +7494,8 @@ declare class SanityClient$1 {
|
|
|
4048
7494
|
/**
|
|
4049
7495
|
* Get a Sanity API URL for the URI provided
|
|
4050
7496
|
*
|
|
7497
|
+
* @category HTTP
|
|
7498
|
+
*
|
|
4051
7499
|
* @param uri - URI/path to build URL for
|
|
4052
7500
|
* @param canUseCdn - Whether or not to allow using the API CDN for this route
|
|
4053
7501
|
*/
|
|
@@ -4055,6 +7503,8 @@ declare class SanityClient$1 {
|
|
|
4055
7503
|
/**
|
|
4056
7504
|
* Get a Sanity API URL for the data operation and path provided
|
|
4057
7505
|
*
|
|
7506
|
+
* @category HTTP
|
|
7507
|
+
*
|
|
4058
7508
|
* @param operation - Data operation (eg `query`, `mutate`, `listen` or similar)
|
|
4059
7509
|
* @param path - Path to append after the operation
|
|
4060
7510
|
*/
|
|
@@ -4388,6 +7838,9 @@ type ClientVariant = ClientVariantConditions | string;
|
|
|
4388
7838
|
type ClientConfigResource = {
|
|
4389
7839
|
type: 'canvas';
|
|
4390
7840
|
id: string;
|
|
7841
|
+
} | {
|
|
7842
|
+
type: 'knowledge-base';
|
|
7843
|
+
id: string;
|
|
4391
7844
|
} | {
|
|
4392
7845
|
type: 'media-library';
|
|
4393
7846
|
id: string;
|
|
@@ -4575,6 +8028,16 @@ interface ClientConfig$1 {
|
|
|
4575
8028
|
collaboration?: {
|
|
4576
8029
|
organizationId?: string;
|
|
4577
8030
|
};
|
|
8031
|
+
/**
|
|
8032
|
+
* Organization-scoped configuration for Context APIs.
|
|
8033
|
+
*
|
|
8034
|
+
* Currently this is used by `context.insights` methods.
|
|
8035
|
+
*
|
|
8036
|
+
* @beta
|
|
8037
|
+
*/
|
|
8038
|
+
context?: {
|
|
8039
|
+
organizationId?: string;
|
|
8040
|
+
};
|
|
4578
8041
|
}
|
|
4579
8042
|
/** @public */
|
|
4580
8043
|
interface InitializedClientConfig$1 extends ClientConfig$1 {
|
|
@@ -4840,6 +8303,7 @@ type DatasetAclMode = 'public' | 'private' | 'custom';
|
|
|
4840
8303
|
/** @public */
|
|
4841
8304
|
type DatasetCreateOptions = {
|
|
4842
8305
|
aclMode?: DatasetAclMode;
|
|
8306
|
+
description?: string | null;
|
|
4843
8307
|
embeddings?: {
|
|
4844
8308
|
enabled: boolean;
|
|
4845
8309
|
projection?: string;
|
|
@@ -4848,6 +8312,7 @@ type DatasetCreateOptions = {
|
|
|
4848
8312
|
/** @public */
|
|
4849
8313
|
type DatasetEditOptions = {
|
|
4850
8314
|
aclMode?: DatasetAclMode;
|
|
8315
|
+
description?: string | null;
|
|
4851
8316
|
};
|
|
4852
8317
|
/** @public */
|
|
4853
8318
|
type EmbeddingsSettings = {
|
|
@@ -4864,17 +8329,22 @@ type EmbeddingsSettingsBody = {
|
|
|
4864
8329
|
type DatasetResponse = {
|
|
4865
8330
|
datasetName: string;
|
|
4866
8331
|
aclMode: DatasetAclMode;
|
|
8332
|
+
description: string | null;
|
|
4867
8333
|
};
|
|
4868
8334
|
/** @public */
|
|
4869
8335
|
type DatasetsResponse = {
|
|
4870
8336
|
name: string;
|
|
4871
8337
|
aclMode: DatasetAclMode;
|
|
8338
|
+
description?: string;
|
|
4872
8339
|
createdAt: string;
|
|
4873
8340
|
createdByUserId: string;
|
|
4874
8341
|
addonFor: string | null;
|
|
4875
8342
|
datasetProfile: string;
|
|
4876
8343
|
features: string[];
|
|
4877
|
-
tags:
|
|
8344
|
+
tags: {
|
|
8345
|
+
name: string;
|
|
8346
|
+
title: string;
|
|
8347
|
+
}[];
|
|
4878
8348
|
}[];
|
|
4879
8349
|
/** @public */
|
|
4880
8350
|
interface SanityProjectMember {
|
|
@@ -6241,8 +9711,46 @@ interface LiveEventGoAway {
|
|
|
6241
9711
|
}
|
|
6242
9712
|
/** @public */
|
|
6243
9713
|
type LiveEvent = LiveEventRestart | LiveEventReconnect | LiveEventMessage | LiveEventWelcome | LiveEventGoAway;
|
|
6244
|
-
|
|
6245
|
-
|
|
9714
|
+
declare global {
|
|
9715
|
+
/**
|
|
9716
|
+
* Query result types, keyed by GROQ query string. Empty by default, `sanity typegen` registers
|
|
9717
|
+
* the queries it finds:
|
|
9718
|
+
* ```ts
|
|
9719
|
+
* declare global {
|
|
9720
|
+
* interface SanityQueries {
|
|
9721
|
+
* '*[_type == "post"]': PostsQueryResult
|
|
9722
|
+
* }
|
|
9723
|
+
* }
|
|
9724
|
+
* ```
|
|
9725
|
+
* `client.fetch(query)` and `ClientReturn<typeof query>` then resolve to the registered type.
|
|
9726
|
+
*
|
|
9727
|
+
* The registry is a global rather than a module augmentation of `@sanity/client` so that it
|
|
9728
|
+
* does not depend on module resolution: it resolves the same whether `@sanity/client` is a
|
|
9729
|
+
* direct dependency, how many copies of it are installed, and from every subpath export.
|
|
9730
|
+
*/
|
|
9731
|
+
interface SanityQueries {}
|
|
9732
|
+
}
|
|
9733
|
+
/**
|
|
9734
|
+
* The query registry as seen from `@sanity/client`. Inherits every query registered on the global
|
|
9735
|
+
* `SanityQueries` interface, and still accepts the older module augmentation form:
|
|
9736
|
+
* ```ts
|
|
9737
|
+
* declare module '@sanity/client' {
|
|
9738
|
+
* interface SanityQueries {
|
|
9739
|
+
* '*[_type == "post"]': PostsQueryResult
|
|
9740
|
+
* }
|
|
9741
|
+
* }
|
|
9742
|
+
* ```
|
|
9743
|
+
* `@sanity/client` releases that predate the global registry only read this interface, so a
|
|
9744
|
+
* generated file that registers queries globally can bridge them with an augmentation that adds
|
|
9745
|
+
* the global as a base type. It is harmless on releases that already inherit it:
|
|
9746
|
+
* ```ts
|
|
9747
|
+
* declare module '@sanity/client' {
|
|
9748
|
+
* interface SanityQueries extends globalThis.SanityQueries {}
|
|
9749
|
+
* }
|
|
9750
|
+
* ```
|
|
9751
|
+
* @public
|
|
9752
|
+
*/
|
|
9753
|
+
interface SanityQueries extends globalThis.SanityQueries {}
|
|
6246
9754
|
/** @public */
|
|
6247
9755
|
type ClientReturn$1<GroqString extends string, Fallback = Any$1> = GroqString extends keyof SanityQueries ? SanityQueries[GroqString] : Fallback;
|
|
6248
9756
|
/**
|
|
@@ -6460,5 +9968,5 @@ interface MediaLibraryAssetDocument {
|
|
|
6460
9968
|
parent?: SanityReference | null;
|
|
6461
9969
|
rootDirectory?: Any$1;
|
|
6462
9970
|
}
|
|
6463
|
-
export { DisconnectEvent as $, UploadClientConfig as $n,
|
|
6464
|
-
//# sourceMappingURL=types-
|
|
9971
|
+
export { DisconnectEvent as $, UploadClientConfig as $n, CollaborationCommentFieldValue as $r, QueryWithoutParams as $t, ContentSourceMapMappings as A, AgentActionPathSegment as Ai, SanityReference as An, ObservableProjectsClient as Ar, MediaLibraryAssetVersion as At, CreateVersionAction as B, TransactionAllDocumentIdsMutationOptions as Bn, ObservablePatchBuilder as Br, MutationSelection as Bt, ContentSourceMap$1 as C, PromptRequest as Ci, SanityDocument$1 as Cn, GenerateTarget as Cr, LiveEventGoAway as Ct, ContentSourceMapDocuments$1 as D, AgentActionParam as Di, SanityProject as Dn, SanityClient$1 as Dr, LiveEventWelcome as Dt, ContentSourceMapDocumentValueSource as E, PatchTarget as Ei, SanityImagePalette as En, ObservableSanityClient$1 as Er, LiveEventRestart as Et, ContentSourceMapValueMapping as F, GroqAgentActionParam as Fi, StackablePerspective as Fn, InvokeFunctionOptions as Fr, Mutation as Ft, DatasetResponse as G, UnarchiveReleaseAction as Gn, ObservablePatch as Gr, PatchOperations as Gt, DatasetAclMode as H, TransactionFirstDocumentIdMutationOptions as Hn, PatchBuilder as Hr, OpenEvent as Ht, CreateAction as I, StillImageFormat as In, InvokeFunctionRequest as Ir, MutationError as It, DeleteReleaseAction as J, UnpublishAction as Jn, types_d_exports as Jr, PublishReleaseAction as Jt, DatasetsResponse as K, UnfilteredResponseQueryOptions as Kn, Patch as Kr, PatchSelection as Kt, CreateReleaseAction as L, StoryboardTransformOptions as Ln, DatasetsClient as Lr, MutationErrorItem as Lt, ContentSourceMapRemoteDocument as M, ConstantAgentActionParam as Mi, ScheduleReleaseAction as Mn, MediaLibraryVideoClient as Mr, MediaLibraryVideoPlaybackTransformations as Mt, ContentSourceMapSource as N, DocumentAgentActionParam as Ni, SingleActionResult as Nn, ObservableMediaLibraryVideoClient as Nr, MultipleActionResult as Nt, ContentSourceMapLiteralSource as O, AgentActionParams as Oi, SanityProjectMember as On, ObservableUsersClient as Or, MediaLibraryAssetDocument as Ot, ContentSourceMapUnknownSource as P, FieldAgentActionParam as Pi, SingleMutationResult as Pn, InvokeFunctionEvent as Pr, MultipleMutationResult as Pt, DiscardVersionAction as Q, UploadBody as Qn, CollaborationCommentDocument as Qr, QueryParseError as Qt, CreateVariantAction as R, SyncTag as Rn, ObservableDatasetsClient as Rr, MutationEvent as Rt, ClientVariantConditions as S, TransformTargetInclude as Si, SanityAssetDocument as Sn, GenerateOperation as Sr, LiveEvent as St, ContentSourceMapDocumentBase as T, PatchOperation as Ti, SanityImageAssetDocument as Tn, GenerateTargetInclude as Tr, LiveEventReconnect as Tt, DatasetCreateOptions as U, TransactionFirstDocumentMutationOptions as Un, Transaction as Ur, PartialExcept as Ut, CurrentSanityUser as V, TransactionAllDocumentsMutationOptions as Vn, ObservableTransaction as Vr, MutationSelectionQueryParams as Vt, DatasetEditOptions as W, TransactionMutationOptions as Wn, BasePatch as Wr, PatchMutationOperation as Wt, DeleteVariantDefinitionAction as X, UnpublishVersionAction as Xn, ObservableCollaborationCommentsClient as Xr, QueryOptions as Xt, DeleteVariantAction as Y, UnpublishVariantAction as Yn, CollaborationCommentsClient as Yr, PublishVariantAction as Yt, DiscardAction as Z, UnscheduleReleaseAction as Zn, CollaborationCommentCreate as Zr, QueryParams as Zt, ChannelErrorEvent as _, ImageDescriptionOperation as _i, Requester as _n, VideoSubtitleInfoPublic as _r, InsertPatch as _t, AllDocumentsMutationOptions as a, CollaborationCommentStatus as ai, ReleaseCardinality as an, VersionAction as ar, EditableReleaseDocument as at, ClientReturn$1 as b, TransformTarget as bi, ResumableListenEventNames as bn, WelcomeEvent as br, ListenOptions as bt, Any$1 as c, CollaborationCommentsListenOptions as ci, ReleaseState as cn, VideoPlaybackInfoItemPublic as cr, ErrorProps as ct, AssetMetadataType as d, _listen as di, ReplaceVersionAction as dn, VideoPlaybackInfoSigned as dr, FirstDocumentMutationOptions as dt, CollaborationCommentMessage as ei, RawQueryResponse$1 as en, UploadEvent as er, EXPERIMENTAL_API_WARNING as et, AttributeSet as f, AssetsClient as fi, RequestHandler as fn, VideoPlaybackTokens as fr, FitMode as ft, BaseMutationOptions as g, TranslateTargetInclude as gi, RequestUrlOptions as gn, VideoSubtitleInfo as gr, InitializedClientConfig$1 as gt, BaseActionOptions as h, TranslateTarget as hi, RequestOptions$1 as hn, VideoRenditionInfoSigned as hr, ImportReleaseAction as ht, AllDocumentIdsMutationOptions as i, CollaborationCommentSelection as ii, ReleaseAction as in, VariantDefinitionAction as ir, EditVariantDefinitionAction as it, ContentSourceMapPaths as j, AgentActionTarget as ji, SanityUser as jn, ProjectsClient as jr, MediaLibraryPlaybackInfoOptions as jt, ContentSourceMapMapping as k, AgentActionPath as ki, SanityQueries as kn, UsersClient as kr, MediaLibraryAssetInstanceIdentifier as kt, ApiError as l, CollaborationCommentsRequestOptions as li, ReleaseType as ln, VideoPlaybackInfoItemSigned as lr, FilteredResponseQueryOptions as lt, AuthProviderResponse as m, TranslateDocument as mi, RequestObservableOptions as mn, VideoRenditionInfoPublic as mr, IdentifiedSanityDocumentStub as mt, ActionError as n, CollaborationCommentRange as ni, RawRequestOptions as nn, UploadResponseEvent as nr, EditReleaseAction as nt, AnimatedImageFormat as o, CollaborationCommentTarget as oi, ReleaseDocument as on, VideoPlaybackInfo as or, EmbeddingsSettings as ot, AuthProvider as p, ObservableAssetsClient as pi, RequestHandlerOptions as pn, VideoRenditionInfo as pr, HttpRequest as pt, DeleteAction as q, UnfilteredResponseWithoutQuery as qn, LiveClient as qr, PublishAction as qt, ActionErrorItem as r, CollaborationCommentReactionShortName as ri, ReconnectEvent as rn, VariantAction as rr, EditVariantAction as rt, AnimatedTransformOptions as s, CollaborationCommentUpdate as si, ReleaseId as sn, VideoPlaybackInfoItem as sr, EmbeddingsSettingsBody as st, Action as t, CollaborationCommentPortableTextBlock as ti, RawQuerylessQueryResponse as tn, UploadProgressEvent as tr, EditAction as tt, ArchiveReleaseAction as u, CollaborationCommentsWriteOptions as ui, ReplaceDraftAction as un, VideoPlaybackInfoPublic as ur, FirstDocumentIdMutationOptions as ut, ClientConfig$1 as v, TransformDocument as vi, ResetEvent as vn, VideoSubtitleInfoSigned as vr, ListenEvent as vt, ContentSourceMapDocument as w, PatchDocument as wi, SanityDocumentStub as wn, GenerateTargetDocument as wr, LiveEventMessage as wt, ClientVariant as x, TransformTargetDocument as xi, ResumableListenOptions as xn, GenerateInstruction as xr, ListenParams as xt, ClientPerspective$1 as y, TransformOperation as yi, ResponseQueryOptions as yn, WelcomeBackEvent as yr, ListenEventName as yt, CreateVariantDefinitionAction as z, ThumbnailTransformOptions as zn, BaseTransaction as zr, MutationOperation as zt };
|
|
9972
|
+
//# sourceMappingURL=types-CtHEe8SF.d.ts.map
|