@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.cjs
CHANGED
|
@@ -1225,6 +1225,7 @@ const MAX_URL_LENGTH = 14800, possibleOptions = [
|
|
|
1225
1225
|
"includeAllVersions",
|
|
1226
1226
|
"visibility",
|
|
1227
1227
|
"effectFormat",
|
|
1228
|
+
"enableResume",
|
|
1228
1229
|
"tag"
|
|
1229
1230
|
], defaultOptions = {
|
|
1230
1231
|
includeResult: !0
|
|
@@ -1373,7 +1374,7 @@ class ObservableDatasetsClient {
|
|
|
1373
1374
|
* Create a new dataset with the given name
|
|
1374
1375
|
*
|
|
1375
1376
|
* @param name - Name of the dataset to create
|
|
1376
|
-
* @param options - Options for the dataset
|
|
1377
|
+
* @param options - Options for the dataset, including optional embeddings configuration
|
|
1377
1378
|
*/
|
|
1378
1379
|
create(name2, options) {
|
|
1379
1380
|
return _modify(this.#client, this.#httpRequest, "PUT", name2, options);
|
|
@@ -1407,6 +1408,31 @@ class ObservableDatasetsClient {
|
|
|
1407
1408
|
tag: null
|
|
1408
1409
|
});
|
|
1409
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
|
+
}
|
|
1410
1436
|
}
|
|
1411
1437
|
class DatasetsClient {
|
|
1412
1438
|
#client;
|
|
@@ -1418,7 +1444,7 @@ class DatasetsClient {
|
|
|
1418
1444
|
* Create a new dataset with the given name
|
|
1419
1445
|
*
|
|
1420
1446
|
* @param name - Name of the dataset to create
|
|
1421
|
-
* @param options - Options for the dataset
|
|
1447
|
+
* @param options - Options for the dataset, including optional embeddings configuration
|
|
1422
1448
|
*/
|
|
1423
1449
|
create(name2, options) {
|
|
1424
1450
|
return config.resourceGuard("dataset", this.#client.config()), rxjs.lastValueFrom(
|
|
@@ -1455,6 +1481,39 @@ class DatasetsClient {
|
|
|
1455
1481
|
_request(this.#client, this.#httpRequest, { uri, tag: null })
|
|
1456
1482
|
);
|
|
1457
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`;
|
|
1458
1517
|
}
|
|
1459
1518
|
function _modify(client, httpRequest, method, name2, options) {
|
|
1460
1519
|
return config.resourceGuard("dataset", client.config()), config.dataset(name2), _request(client, httpRequest, {
|
|
@@ -2690,7 +2749,7 @@ function defineDeprecatedCreateClient(createClient2) {
|
|
|
2690
2749
|
return config.printNoDefaultExport(), createClient2(config$1);
|
|
2691
2750
|
};
|
|
2692
2751
|
}
|
|
2693
|
-
var name = "@sanity/client", version = "7.
|
|
2752
|
+
var name = "@sanity/client", version = "7.16.0";
|
|
2694
2753
|
const middleware = [
|
|
2695
2754
|
middleware$1.debug({ verbose: !0, namespace: "sanity:client" }),
|
|
2696
2755
|
middleware$1.headers({ "User-Agent": `${name} ${version}` }),
|