@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.js CHANGED
@@ -1211,6 +1211,7 @@ const MAX_URL_LENGTH = 14800, possibleOptions = [
1211
1211
  "includeAllVersions",
1212
1212
  "visibility",
1213
1213
  "effectFormat",
1214
+ "enableResume",
1214
1215
  "tag"
1215
1216
  ], defaultOptions = {
1216
1217
  includeResult: !0
@@ -1359,7 +1360,7 @@ class ObservableDatasetsClient {
1359
1360
  * Create a new dataset with the given name
1360
1361
  *
1361
1362
  * @param name - Name of the dataset to create
1362
- * @param options - Options for the dataset
1363
+ * @param options - Options for the dataset, including optional embeddings configuration
1363
1364
  */
1364
1365
  create(name2, options) {
1365
1366
  return _modify(this.#client, this.#httpRequest, "PUT", name2, options);
@@ -1393,6 +1394,31 @@ class ObservableDatasetsClient {
1393
1394
  tag: null
1394
1395
  });
1395
1396
  }
1397
+ /**
1398
+ * Get embeddings settings for a dataset
1399
+ *
1400
+ * @param name - Name of the dataset
1401
+ */
1402
+ getEmbeddingsSettings(name2) {
1403
+ return resourceGuard("dataset", this.#client.config()), dataset(name2), _request(this.#client, this.#httpRequest, {
1404
+ uri: _embeddingsSettingsUri(this.#client, name2),
1405
+ tag: null
1406
+ });
1407
+ }
1408
+ /**
1409
+ * Edit embeddings settings for a dataset
1410
+ *
1411
+ * @param name - Name of the dataset
1412
+ * @param settings - Embeddings settings to apply
1413
+ */
1414
+ editEmbeddingsSettings(name2, settings) {
1415
+ return resourceGuard("dataset", this.#client.config()), dataset(name2), _request(this.#client, this.#httpRequest, {
1416
+ method: "PUT",
1417
+ uri: _embeddingsSettingsUri(this.#client, name2),
1418
+ body: settings,
1419
+ tag: null
1420
+ });
1421
+ }
1396
1422
  }
1397
1423
  class DatasetsClient {
1398
1424
  #client;
@@ -1404,7 +1430,7 @@ class DatasetsClient {
1404
1430
  * Create a new dataset with the given name
1405
1431
  *
1406
1432
  * @param name - Name of the dataset to create
1407
- * @param options - Options for the dataset
1433
+ * @param options - Options for the dataset, including optional embeddings configuration
1408
1434
  */
1409
1435
  create(name2, options) {
1410
1436
  return resourceGuard("dataset", this.#client.config()), lastValueFrom(
@@ -1441,6 +1467,39 @@ class DatasetsClient {
1441
1467
  _request(this.#client, this.#httpRequest, { uri, tag: null })
1442
1468
  );
1443
1469
  }
1470
+ /**
1471
+ * Get embeddings settings for a dataset
1472
+ *
1473
+ * @param name - Name of the dataset
1474
+ */
1475
+ getEmbeddingsSettings(name2) {
1476
+ return resourceGuard("dataset", this.#client.config()), dataset(name2), lastValueFrom(
1477
+ _request(this.#client, this.#httpRequest, {
1478
+ uri: _embeddingsSettingsUri(this.#client, name2),
1479
+ tag: null
1480
+ })
1481
+ );
1482
+ }
1483
+ /**
1484
+ * Edit embeddings settings for a dataset
1485
+ *
1486
+ * @param name - Name of the dataset
1487
+ * @param settings - Embeddings settings to apply
1488
+ */
1489
+ editEmbeddingsSettings(name2, settings) {
1490
+ return resourceGuard("dataset", this.#client.config()), dataset(name2), lastValueFrom(
1491
+ _request(this.#client, this.#httpRequest, {
1492
+ method: "PUT",
1493
+ uri: _embeddingsSettingsUri(this.#client, name2),
1494
+ body: settings,
1495
+ tag: null
1496
+ })
1497
+ );
1498
+ }
1499
+ }
1500
+ function _embeddingsSettingsUri(client, name2) {
1501
+ const config = client.config();
1502
+ return config.useProjectHostname === !1 ? `/projects/${config.projectId}/datasets/${name2}/settings/embeddings` : `/datasets/${name2}/settings/embeddings`;
1444
1503
  }
1445
1504
  function _modify(client, httpRequest, method, name2, options) {
1446
1505
  return resourceGuard("dataset", client.config()), dataset(name2), _request(client, httpRequest, {
@@ -2676,7 +2735,7 @@ function defineDeprecatedCreateClient(createClient2) {
2676
2735
  return printNoDefaultExport(), createClient2(config);
2677
2736
  };
2678
2737
  }
2679
- var name = "@sanity/client", version = "7.14.1";
2738
+ var name = "@sanity/client", version = "7.16.0";
2680
2739
  const middleware = [
2681
2740
  debug({ verbose: !0, namespace: "sanity:client" }),
2682
2741
  headers({ "User-Agent": `${name} ${version}` }),