@sanity/client 7.9.0 → 7.10.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
@@ -2457,9 +2457,13 @@ export declare class ObservableProjectsClient {
2457
2457
  *
2458
2458
  * @param options - Options for the list request
2459
2459
  * - `includeMembers` - Whether to include members in the response (default: true)
2460
+ * - `organizationId` - ID of the organization to fetch projects for
2460
2461
  */
2461
- list(options?: {includeMembers?: true}): Observable<SanityProject[]>
2462
- list(options?: {includeMembers?: false}): Observable<Omit<SanityProject, 'members'>[]>
2462
+ list(options?: {includeMembers?: true; organizationId?: string}): Observable<SanityProject[]>
2463
+ list(options?: {
2464
+ includeMembers?: false
2465
+ organizationId?: string
2466
+ }): Observable<Omit<SanityProject, 'members'>[]>
2463
2467
  /**
2464
2468
  * Fetch a project by project ID
2465
2469
  *
@@ -3811,9 +3815,13 @@ export declare class ProjectsClient {
3811
3815
  *
3812
3816
  * @param options - Options for the list request
3813
3817
  * - `includeMembers` - Whether to include members in the response (default: true)
3818
+ * - `organizationId` - ID of the organization to fetch projects for
3814
3819
  */
3815
- list(options?: {includeMembers?: true}): Promise<SanityProject[]>
3816
- list(options?: {includeMembers?: false}): Promise<Omit<SanityProject, 'members'>[]>
3820
+ list(options?: {includeMembers?: true; organizationId?: string}): Promise<SanityProject[]>
3821
+ list(options?: {
3822
+ includeMembers?: false
3823
+ organizationId?: string
3824
+ }): Promise<Omit<SanityProject, 'members'>[]>
3817
3825
  /**
3818
3826
  * Fetch a project by project ID
3819
3827
  *
package/dist/index.d.ts CHANGED
@@ -2457,9 +2457,13 @@ export declare class ObservableProjectsClient {
2457
2457
  *
2458
2458
  * @param options - Options for the list request
2459
2459
  * - `includeMembers` - Whether to include members in the response (default: true)
2460
+ * - `organizationId` - ID of the organization to fetch projects for
2460
2461
  */
2461
- list(options?: {includeMembers?: true}): Observable<SanityProject[]>
2462
- list(options?: {includeMembers?: false}): Observable<Omit<SanityProject, 'members'>[]>
2462
+ list(options?: {includeMembers?: true; organizationId?: string}): Observable<SanityProject[]>
2463
+ list(options?: {
2464
+ includeMembers?: false
2465
+ organizationId?: string
2466
+ }): Observable<Omit<SanityProject, 'members'>[]>
2463
2467
  /**
2464
2468
  * Fetch a project by project ID
2465
2469
  *
@@ -3811,9 +3815,13 @@ export declare class ProjectsClient {
3811
3815
  *
3812
3816
  * @param options - Options for the list request
3813
3817
  * - `includeMembers` - Whether to include members in the response (default: true)
3818
+ * - `organizationId` - ID of the organization to fetch projects for
3814
3819
  */
3815
- list(options?: {includeMembers?: true}): Promise<SanityProject[]>
3816
- list(options?: {includeMembers?: false}): Promise<Omit<SanityProject, 'members'>[]>
3820
+ list(options?: {includeMembers?: true; organizationId?: string}): Promise<SanityProject[]>
3821
+ list(options?: {
3822
+ includeMembers?: false
3823
+ organizationId?: string
3824
+ }): Promise<Omit<SanityProject, 'members'>[]>
3817
3825
  /**
3818
3826
  * Fetch a project by project ID
3819
3827
  *
package/dist/index.js CHANGED
@@ -1438,8 +1438,8 @@ class ObservableProjectsClient {
1438
1438
  this.#client = client, this.#httpRequest = httpRequest;
1439
1439
  }
1440
1440
  list(options) {
1441
- const uri = options?.includeMembers === !1 ? "/projects?includeMembers=false" : "/projects";
1442
- return _request(this.#client, this.#httpRequest, { uri });
1441
+ const query = {}, uri = "/projects";
1442
+ return options?.includeMembers === !1 && (query.includeMembers = "false"), options?.organizationId && (query.organizationId = options.organizationId), _request(this.#client, this.#httpRequest, { uri, query });
1443
1443
  }
1444
1444
  /**
1445
1445
  * Fetch a project by project ID
@@ -1457,8 +1457,8 @@ class ProjectsClient {
1457
1457
  this.#client = client, this.#httpRequest = httpRequest;
1458
1458
  }
1459
1459
  list(options) {
1460
- const uri = options?.includeMembers === !1 ? "/projects?includeMembers=false" : "/projects";
1461
- return lastValueFrom(_request(this.#client, this.#httpRequest, { uri }));
1460
+ const query = {}, uri = "/projects";
1461
+ return options?.includeMembers === !1 && (query.includeMembers = "false"), options?.organizationId && (query.organizationId = options.organizationId), lastValueFrom(_request(this.#client, this.#httpRequest, { uri, query }));
1462
1462
  }
1463
1463
  /**
1464
1464
  * Fetch a project by project ID
@@ -2564,7 +2564,7 @@ function defineDeprecatedCreateClient(createClient2) {
2564
2564
  return printNoDefaultExport(), createClient2(config);
2565
2565
  };
2566
2566
  }
2567
- var name = "@sanity/client", version = "7.9.0";
2567
+ var name = "@sanity/client", version = "7.10.0";
2568
2568
  const middleware = [
2569
2569
  debug({ verbose: !0, namespace: "sanity:client" }),
2570
2570
  headers({ "User-Agent": `${name} ${version}` }),