@sanity/client 7.8.2 → 7.9.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.d.cts CHANGED
@@ -4106,6 +4106,9 @@ export declare type ReleaseAction =
4106
4106
  | UnscheduleReleaseAction
4107
4107
  | DeleteReleaseAction
4108
4108
 
4109
+ /** @public */
4110
+ export declare type ReleaseCardinality = 'many' | 'one' | undefined
4111
+
4109
4112
  /** @internal */
4110
4113
  export declare interface ReleaseDocument extends SanityDocument {
4111
4114
  /**
@@ -4142,6 +4145,7 @@ export declare interface ReleaseDocument extends SanityDocument {
4142
4145
  description?: string
4143
4146
  intendedPublishAt?: string
4144
4147
  releaseType: ReleaseType
4148
+ cardinality?: ReleaseCardinality
4145
4149
  }
4146
4150
  }
4147
4151
 
package/dist/index.d.ts CHANGED
@@ -4106,6 +4106,9 @@ export declare type ReleaseAction =
4106
4106
  | UnscheduleReleaseAction
4107
4107
  | DeleteReleaseAction
4108
4108
 
4109
+ /** @public */
4110
+ export declare type ReleaseCardinality = 'many' | 'one' | undefined
4111
+
4109
4112
  /** @internal */
4110
4113
  export declare interface ReleaseDocument extends SanityDocument {
4111
4114
  /**
@@ -4142,6 +4145,7 @@ export declare interface ReleaseDocument extends SanityDocument {
4142
4145
  description?: string
4143
4146
  intendedPublishAt?: string
4144
4147
  releaseType: ReleaseType
4148
+ cardinality?: ReleaseCardinality
4145
4149
  }
4146
4150
  }
4147
4151
 
package/dist/index.js CHANGED
@@ -1366,8 +1366,11 @@ class ObservableDatasetsClient {
1366
1366
  * Fetch a list of datasets for the configured project
1367
1367
  */
1368
1368
  list() {
1369
- return _request(this.#client, this.#httpRequest, {
1370
- uri: "/datasets",
1369
+ resourceGuard("dataset", this.#client.config());
1370
+ const config = this.#client.config(), projectId = config.projectId;
1371
+ let uri = "/datasets";
1372
+ return config.useProjectHostname === !1 && (uri = `/projects/${projectId}/datasets`), _request(this.#client, this.#httpRequest, {
1373
+ uri,
1371
1374
  tag: null
1372
1375
  });
1373
1376
  }
@@ -1412,8 +1415,11 @@ class DatasetsClient {
1412
1415
  * Fetch a list of datasets for the configured project
1413
1416
  */
1414
1417
  list() {
1415
- return resourceGuard("dataset", this.#client.config()), lastValueFrom(
1416
- _request(this.#client, this.#httpRequest, { uri: "/datasets", tag: null })
1418
+ resourceGuard("dataset", this.#client.config());
1419
+ const config = this.#client.config(), projectId = config.projectId;
1420
+ let uri = "/datasets";
1421
+ return config.useProjectHostname === !1 && (uri = `/projects/${projectId}/datasets`), lastValueFrom(
1422
+ _request(this.#client, this.#httpRequest, { uri, tag: null })
1417
1423
  );
1418
1424
  }
1419
1425
  }
@@ -1432,7 +1438,6 @@ class ObservableProjectsClient {
1432
1438
  this.#client = client, this.#httpRequest = httpRequest;
1433
1439
  }
1434
1440
  list(options) {
1435
- resourceGuard("projects", this.#client.config());
1436
1441
  const uri = options?.includeMembers === !1 ? "/projects?includeMembers=false" : "/projects";
1437
1442
  return _request(this.#client, this.#httpRequest, { uri });
1438
1443
  }
@@ -1442,7 +1447,7 @@ class ObservableProjectsClient {
1442
1447
  * @param projectId - ID of the project to fetch
1443
1448
  */
1444
1449
  getById(projectId) {
1445
- return resourceGuard("projects", this.#client.config()), _request(this.#client, this.#httpRequest, { uri: `/projects/${projectId}` });
1450
+ return _request(this.#client, this.#httpRequest, { uri: `/projects/${projectId}` });
1446
1451
  }
1447
1452
  }
1448
1453
  class ProjectsClient {
@@ -1452,7 +1457,6 @@ class ProjectsClient {
1452
1457
  this.#client = client, this.#httpRequest = httpRequest;
1453
1458
  }
1454
1459
  list(options) {
1455
- resourceGuard("projects", this.#client.config());
1456
1460
  const uri = options?.includeMembers === !1 ? "/projects?includeMembers=false" : "/projects";
1457
1461
  return lastValueFrom(_request(this.#client, this.#httpRequest, { uri }));
1458
1462
  }
@@ -1462,7 +1466,7 @@ class ProjectsClient {
1462
1466
  * @param projectId - ID of the project to fetch
1463
1467
  */
1464
1468
  getById(projectId) {
1465
- return resourceGuard("projects", this.#client.config()), lastValueFrom(
1469
+ return lastValueFrom(
1466
1470
  _request(this.#client, this.#httpRequest, { uri: `/projects/${projectId}` })
1467
1471
  );
1468
1472
  }
@@ -2560,7 +2564,7 @@ function defineDeprecatedCreateClient(createClient2) {
2560
2564
  return printNoDefaultExport(), createClient2(config);
2561
2565
  };
2562
2566
  }
2563
- var name = "@sanity/client", version = "7.8.2";
2567
+ var name = "@sanity/client", version = "7.9.0";
2564
2568
  const middleware = [
2565
2569
  debug({ verbose: !0, namespace: "sanity:client" }),
2566
2570
  headers({ "User-Agent": `${name} ${version}` }),