@sanity/client 7.14.1 → 7.16.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/dist/index.browser.cjs +61 -2
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.d.cts +151 -38
- package/dist/index.browser.d.ts +151 -38
- package/dist/index.browser.js +61 -2
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +62 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +151 -38
- package/dist/index.d.ts +151 -38
- package/dist/index.js +62 -3
- package/dist/index.js.map +1 -1
- package/dist/stega.browser.d.cts +151 -38
- package/dist/stega.browser.d.ts +151 -38
- package/dist/stega.d.cts +151 -38
- package/dist/stega.d.ts +151 -38
- package/package.json +1 -1
- package/src/data/listen.ts +21 -9
- package/src/datasets/DatasetsClient.ts +93 -8
- package/src/types.ts +105 -4
- package/umd/sanityClient.js +61 -2
- package/umd/sanityClient.min.js +2 -2
package/dist/index.browser.cjs
CHANGED
|
@@ -1409,6 +1409,7 @@ const MAX_URL_LENGTH = 14800, possibleOptions = [
|
|
|
1409
1409
|
"includeAllVersions",
|
|
1410
1410
|
"visibility",
|
|
1411
1411
|
"effectFormat",
|
|
1412
|
+
"enableResume",
|
|
1412
1413
|
"tag"
|
|
1413
1414
|
], defaultOptions = {
|
|
1414
1415
|
includeResult: !0
|
|
@@ -1557,7 +1558,7 @@ class ObservableDatasetsClient {
|
|
|
1557
1558
|
* Create a new dataset with the given name
|
|
1558
1559
|
*
|
|
1559
1560
|
* @param name - Name of the dataset to create
|
|
1560
|
-
* @param options - Options for the dataset
|
|
1561
|
+
* @param options - Options for the dataset, including optional embeddings configuration
|
|
1561
1562
|
*/
|
|
1562
1563
|
create(name, options) {
|
|
1563
1564
|
return _modify(this.#client, this.#httpRequest, "PUT", name, options);
|
|
@@ -1591,6 +1592,31 @@ class ObservableDatasetsClient {
|
|
|
1591
1592
|
tag: null
|
|
1592
1593
|
});
|
|
1593
1594
|
}
|
|
1595
|
+
/**
|
|
1596
|
+
* Get embeddings settings for a dataset
|
|
1597
|
+
*
|
|
1598
|
+
* @param name - Name of the dataset
|
|
1599
|
+
*/
|
|
1600
|
+
getEmbeddingsSettings(name) {
|
|
1601
|
+
return resourceGuard("dataset", this.#client.config()), dataset(name), _request(this.#client, this.#httpRequest, {
|
|
1602
|
+
uri: _embeddingsSettingsUri(this.#client, name),
|
|
1603
|
+
tag: null
|
|
1604
|
+
});
|
|
1605
|
+
}
|
|
1606
|
+
/**
|
|
1607
|
+
* Edit embeddings settings for a dataset
|
|
1608
|
+
*
|
|
1609
|
+
* @param name - Name of the dataset
|
|
1610
|
+
* @param settings - Embeddings settings to apply
|
|
1611
|
+
*/
|
|
1612
|
+
editEmbeddingsSettings(name, settings) {
|
|
1613
|
+
return resourceGuard("dataset", this.#client.config()), dataset(name), _request(this.#client, this.#httpRequest, {
|
|
1614
|
+
method: "PUT",
|
|
1615
|
+
uri: _embeddingsSettingsUri(this.#client, name),
|
|
1616
|
+
body: settings,
|
|
1617
|
+
tag: null
|
|
1618
|
+
});
|
|
1619
|
+
}
|
|
1594
1620
|
}
|
|
1595
1621
|
class DatasetsClient {
|
|
1596
1622
|
#client;
|
|
@@ -1602,7 +1628,7 @@ class DatasetsClient {
|
|
|
1602
1628
|
* Create a new dataset with the given name
|
|
1603
1629
|
*
|
|
1604
1630
|
* @param name - Name of the dataset to create
|
|
1605
|
-
* @param options - Options for the dataset
|
|
1631
|
+
* @param options - Options for the dataset, including optional embeddings configuration
|
|
1606
1632
|
*/
|
|
1607
1633
|
create(name, options) {
|
|
1608
1634
|
return resourceGuard("dataset", this.#client.config()), rxjs.lastValueFrom(
|
|
@@ -1639,6 +1665,39 @@ class DatasetsClient {
|
|
|
1639
1665
|
_request(this.#client, this.#httpRequest, { uri, tag: null })
|
|
1640
1666
|
);
|
|
1641
1667
|
}
|
|
1668
|
+
/**
|
|
1669
|
+
* Get embeddings settings for a dataset
|
|
1670
|
+
*
|
|
1671
|
+
* @param name - Name of the dataset
|
|
1672
|
+
*/
|
|
1673
|
+
getEmbeddingsSettings(name) {
|
|
1674
|
+
return resourceGuard("dataset", this.#client.config()), dataset(name), rxjs.lastValueFrom(
|
|
1675
|
+
_request(this.#client, this.#httpRequest, {
|
|
1676
|
+
uri: _embeddingsSettingsUri(this.#client, name),
|
|
1677
|
+
tag: null
|
|
1678
|
+
})
|
|
1679
|
+
);
|
|
1680
|
+
}
|
|
1681
|
+
/**
|
|
1682
|
+
* Edit embeddings settings for a dataset
|
|
1683
|
+
*
|
|
1684
|
+
* @param name - Name of the dataset
|
|
1685
|
+
* @param settings - Embeddings settings to apply
|
|
1686
|
+
*/
|
|
1687
|
+
editEmbeddingsSettings(name, settings) {
|
|
1688
|
+
return resourceGuard("dataset", this.#client.config()), dataset(name), rxjs.lastValueFrom(
|
|
1689
|
+
_request(this.#client, this.#httpRequest, {
|
|
1690
|
+
method: "PUT",
|
|
1691
|
+
uri: _embeddingsSettingsUri(this.#client, name),
|
|
1692
|
+
body: settings,
|
|
1693
|
+
tag: null
|
|
1694
|
+
})
|
|
1695
|
+
);
|
|
1696
|
+
}
|
|
1697
|
+
}
|
|
1698
|
+
function _embeddingsSettingsUri(client, name) {
|
|
1699
|
+
const config = client.config();
|
|
1700
|
+
return config.useProjectHostname === !1 ? `/projects/${config.projectId}/datasets/${name}/settings/embeddings` : `/datasets/${name}/settings/embeddings`;
|
|
1642
1701
|
}
|
|
1643
1702
|
function _modify(client, httpRequest, method, name, options) {
|
|
1644
1703
|
return resourceGuard("dataset", client.config()), dataset(name), _request(client, httpRequest, {
|