@sanity/client 7.15.0 → 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 +60 -2
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.d.cts +59 -26
- package/dist/index.browser.d.ts +59 -26
- package/dist/index.browser.js +60 -2
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +61 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +59 -26
- package/dist/index.d.ts +59 -26
- package/dist/index.js +61 -3
- package/dist/index.js.map +1 -1
- package/dist/stega.browser.d.cts +59 -26
- package/dist/stega.browser.d.ts +59 -26
- package/dist/stega.d.cts +59 -26
- package/dist/stega.d.ts +59 -26
- package/package.json +1 -1
- package/src/datasets/DatasetsClient.ts +93 -8
- package/src/types.ts +27 -0
- package/umd/sanityClient.js +60 -2
- package/umd/sanityClient.min.js +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1374,7 +1374,7 @@ class ObservableDatasetsClient {
|
|
|
1374
1374
|
* Create a new dataset with the given name
|
|
1375
1375
|
*
|
|
1376
1376
|
* @param name - Name of the dataset to create
|
|
1377
|
-
* @param options - Options for the dataset
|
|
1377
|
+
* @param options - Options for the dataset, including optional embeddings configuration
|
|
1378
1378
|
*/
|
|
1379
1379
|
create(name2, options) {
|
|
1380
1380
|
return _modify(this.#client, this.#httpRequest, "PUT", name2, options);
|
|
@@ -1408,6 +1408,31 @@ class ObservableDatasetsClient {
|
|
|
1408
1408
|
tag: null
|
|
1409
1409
|
});
|
|
1410
1410
|
}
|
|
1411
|
+
/**
|
|
1412
|
+
* Get embeddings settings for a dataset
|
|
1413
|
+
*
|
|
1414
|
+
* @param name - Name of the dataset
|
|
1415
|
+
*/
|
|
1416
|
+
getEmbeddingsSettings(name2) {
|
|
1417
|
+
return config.resourceGuard("dataset", this.#client.config()), config.dataset(name2), _request(this.#client, this.#httpRequest, {
|
|
1418
|
+
uri: _embeddingsSettingsUri(this.#client, name2),
|
|
1419
|
+
tag: null
|
|
1420
|
+
});
|
|
1421
|
+
}
|
|
1422
|
+
/**
|
|
1423
|
+
* Edit embeddings settings for a dataset
|
|
1424
|
+
*
|
|
1425
|
+
* @param name - Name of the dataset
|
|
1426
|
+
* @param settings - Embeddings settings to apply
|
|
1427
|
+
*/
|
|
1428
|
+
editEmbeddingsSettings(name2, settings) {
|
|
1429
|
+
return config.resourceGuard("dataset", this.#client.config()), config.dataset(name2), _request(this.#client, this.#httpRequest, {
|
|
1430
|
+
method: "PUT",
|
|
1431
|
+
uri: _embeddingsSettingsUri(this.#client, name2),
|
|
1432
|
+
body: settings,
|
|
1433
|
+
tag: null
|
|
1434
|
+
});
|
|
1435
|
+
}
|
|
1411
1436
|
}
|
|
1412
1437
|
class DatasetsClient {
|
|
1413
1438
|
#client;
|
|
@@ -1419,7 +1444,7 @@ class DatasetsClient {
|
|
|
1419
1444
|
* Create a new dataset with the given name
|
|
1420
1445
|
*
|
|
1421
1446
|
* @param name - Name of the dataset to create
|
|
1422
|
-
* @param options - Options for the dataset
|
|
1447
|
+
* @param options - Options for the dataset, including optional embeddings configuration
|
|
1423
1448
|
*/
|
|
1424
1449
|
create(name2, options) {
|
|
1425
1450
|
return config.resourceGuard("dataset", this.#client.config()), rxjs.lastValueFrom(
|
|
@@ -1456,6 +1481,39 @@ class DatasetsClient {
|
|
|
1456
1481
|
_request(this.#client, this.#httpRequest, { uri, tag: null })
|
|
1457
1482
|
);
|
|
1458
1483
|
}
|
|
1484
|
+
/**
|
|
1485
|
+
* Get embeddings settings for a dataset
|
|
1486
|
+
*
|
|
1487
|
+
* @param name - Name of the dataset
|
|
1488
|
+
*/
|
|
1489
|
+
getEmbeddingsSettings(name2) {
|
|
1490
|
+
return config.resourceGuard("dataset", this.#client.config()), config.dataset(name2), rxjs.lastValueFrom(
|
|
1491
|
+
_request(this.#client, this.#httpRequest, {
|
|
1492
|
+
uri: _embeddingsSettingsUri(this.#client, name2),
|
|
1493
|
+
tag: null
|
|
1494
|
+
})
|
|
1495
|
+
);
|
|
1496
|
+
}
|
|
1497
|
+
/**
|
|
1498
|
+
* Edit embeddings settings for a dataset
|
|
1499
|
+
*
|
|
1500
|
+
* @param name - Name of the dataset
|
|
1501
|
+
* @param settings - Embeddings settings to apply
|
|
1502
|
+
*/
|
|
1503
|
+
editEmbeddingsSettings(name2, settings) {
|
|
1504
|
+
return config.resourceGuard("dataset", this.#client.config()), config.dataset(name2), rxjs.lastValueFrom(
|
|
1505
|
+
_request(this.#client, this.#httpRequest, {
|
|
1506
|
+
method: "PUT",
|
|
1507
|
+
uri: _embeddingsSettingsUri(this.#client, name2),
|
|
1508
|
+
body: settings,
|
|
1509
|
+
tag: null
|
|
1510
|
+
})
|
|
1511
|
+
);
|
|
1512
|
+
}
|
|
1513
|
+
}
|
|
1514
|
+
function _embeddingsSettingsUri(client, name2) {
|
|
1515
|
+
const config2 = client.config();
|
|
1516
|
+
return config2.useProjectHostname === !1 ? `/projects/${config2.projectId}/datasets/${name2}/settings/embeddings` : `/datasets/${name2}/settings/embeddings`;
|
|
1459
1517
|
}
|
|
1460
1518
|
function _modify(client, httpRequest, method, name2, options) {
|
|
1461
1519
|
return config.resourceGuard("dataset", client.config()), config.dataset(name2), _request(client, httpRequest, {
|
|
@@ -2691,7 +2749,7 @@ function defineDeprecatedCreateClient(createClient2) {
|
|
|
2691
2749
|
return config.printNoDefaultExport(), createClient2(config$1);
|
|
2692
2750
|
};
|
|
2693
2751
|
}
|
|
2694
|
-
var name = "@sanity/client", version = "7.
|
|
2752
|
+
var name = "@sanity/client", version = "7.16.0";
|
|
2695
2753
|
const middleware = [
|
|
2696
2754
|
middleware$1.debug({ verbose: !0, namespace: "sanity:client" }),
|
|
2697
2755
|
middleware$1.headers({ "User-Agent": `${name} ${version}` }),
|