@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.js
CHANGED
|
@@ -1393,6 +1393,7 @@ const MAX_URL_LENGTH = 14800, possibleOptions = [
|
|
|
1393
1393
|
"includeAllVersions",
|
|
1394
1394
|
"visibility",
|
|
1395
1395
|
"effectFormat",
|
|
1396
|
+
"enableResume",
|
|
1396
1397
|
"tag"
|
|
1397
1398
|
], defaultOptions = {
|
|
1398
1399
|
includeResult: !0
|
|
@@ -1541,7 +1542,7 @@ class ObservableDatasetsClient {
|
|
|
1541
1542
|
* Create a new dataset with the given name
|
|
1542
1543
|
*
|
|
1543
1544
|
* @param name - Name of the dataset to create
|
|
1544
|
-
* @param options - Options for the dataset
|
|
1545
|
+
* @param options - Options for the dataset, including optional embeddings configuration
|
|
1545
1546
|
*/
|
|
1546
1547
|
create(name, options) {
|
|
1547
1548
|
return _modify(this.#client, this.#httpRequest, "PUT", name, options);
|
|
@@ -1575,6 +1576,31 @@ class ObservableDatasetsClient {
|
|
|
1575
1576
|
tag: null
|
|
1576
1577
|
});
|
|
1577
1578
|
}
|
|
1579
|
+
/**
|
|
1580
|
+
* Get embeddings settings for a dataset
|
|
1581
|
+
*
|
|
1582
|
+
* @param name - Name of the dataset
|
|
1583
|
+
*/
|
|
1584
|
+
getEmbeddingsSettings(name) {
|
|
1585
|
+
return resourceGuard("dataset", this.#client.config()), dataset(name), _request(this.#client, this.#httpRequest, {
|
|
1586
|
+
uri: _embeddingsSettingsUri(this.#client, name),
|
|
1587
|
+
tag: null
|
|
1588
|
+
});
|
|
1589
|
+
}
|
|
1590
|
+
/**
|
|
1591
|
+
* Edit embeddings settings for a dataset
|
|
1592
|
+
*
|
|
1593
|
+
* @param name - Name of the dataset
|
|
1594
|
+
* @param settings - Embeddings settings to apply
|
|
1595
|
+
*/
|
|
1596
|
+
editEmbeddingsSettings(name, settings) {
|
|
1597
|
+
return resourceGuard("dataset", this.#client.config()), dataset(name), _request(this.#client, this.#httpRequest, {
|
|
1598
|
+
method: "PUT",
|
|
1599
|
+
uri: _embeddingsSettingsUri(this.#client, name),
|
|
1600
|
+
body: settings,
|
|
1601
|
+
tag: null
|
|
1602
|
+
});
|
|
1603
|
+
}
|
|
1578
1604
|
}
|
|
1579
1605
|
class DatasetsClient {
|
|
1580
1606
|
#client;
|
|
@@ -1586,7 +1612,7 @@ class DatasetsClient {
|
|
|
1586
1612
|
* Create a new dataset with the given name
|
|
1587
1613
|
*
|
|
1588
1614
|
* @param name - Name of the dataset to create
|
|
1589
|
-
* @param options - Options for the dataset
|
|
1615
|
+
* @param options - Options for the dataset, including optional embeddings configuration
|
|
1590
1616
|
*/
|
|
1591
1617
|
create(name, options) {
|
|
1592
1618
|
return resourceGuard("dataset", this.#client.config()), lastValueFrom(
|
|
@@ -1623,6 +1649,39 @@ class DatasetsClient {
|
|
|
1623
1649
|
_request(this.#client, this.#httpRequest, { uri, tag: null })
|
|
1624
1650
|
);
|
|
1625
1651
|
}
|
|
1652
|
+
/**
|
|
1653
|
+
* Get embeddings settings for a dataset
|
|
1654
|
+
*
|
|
1655
|
+
* @param name - Name of the dataset
|
|
1656
|
+
*/
|
|
1657
|
+
getEmbeddingsSettings(name) {
|
|
1658
|
+
return resourceGuard("dataset", this.#client.config()), dataset(name), lastValueFrom(
|
|
1659
|
+
_request(this.#client, this.#httpRequest, {
|
|
1660
|
+
uri: _embeddingsSettingsUri(this.#client, name),
|
|
1661
|
+
tag: null
|
|
1662
|
+
})
|
|
1663
|
+
);
|
|
1664
|
+
}
|
|
1665
|
+
/**
|
|
1666
|
+
* Edit embeddings settings for a dataset
|
|
1667
|
+
*
|
|
1668
|
+
* @param name - Name of the dataset
|
|
1669
|
+
* @param settings - Embeddings settings to apply
|
|
1670
|
+
*/
|
|
1671
|
+
editEmbeddingsSettings(name, settings) {
|
|
1672
|
+
return resourceGuard("dataset", this.#client.config()), dataset(name), lastValueFrom(
|
|
1673
|
+
_request(this.#client, this.#httpRequest, {
|
|
1674
|
+
method: "PUT",
|
|
1675
|
+
uri: _embeddingsSettingsUri(this.#client, name),
|
|
1676
|
+
body: settings,
|
|
1677
|
+
tag: null
|
|
1678
|
+
})
|
|
1679
|
+
);
|
|
1680
|
+
}
|
|
1681
|
+
}
|
|
1682
|
+
function _embeddingsSettingsUri(client, name) {
|
|
1683
|
+
const config = client.config();
|
|
1684
|
+
return config.useProjectHostname === !1 ? `/projects/${config.projectId}/datasets/${name}/settings/embeddings` : `/datasets/${name}/settings/embeddings`;
|
|
1626
1685
|
}
|
|
1627
1686
|
function _modify(client, httpRequest, method, name, options) {
|
|
1628
1687
|
return resourceGuard("dataset", client.config()), dataset(name), _request(client, httpRequest, {
|