@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.
@@ -2465,9 +2465,13 @@ export declare class ObservableProjectsClient {
2465
2465
  *
2466
2466
  * @param options - Options for the list request
2467
2467
  * - `includeMembers` - Whether to include members in the response (default: true)
2468
+ * - `organizationId` - ID of the organization to fetch projects for
2468
2469
  */
2469
- list(options?: {includeMembers?: true}): Observable<SanityProject[]>
2470
- list(options?: {includeMembers?: false}): Observable<Omit<SanityProject, 'members'>[]>
2470
+ list(options?: {includeMembers?: true; organizationId?: string}): Observable<SanityProject[]>
2471
+ list(options?: {
2472
+ includeMembers?: false
2473
+ organizationId?: string
2474
+ }): Observable<Omit<SanityProject, 'members'>[]>
2471
2475
  /**
2472
2476
  * Fetch a project by project ID
2473
2477
  *
@@ -3819,9 +3823,13 @@ export declare class ProjectsClient {
3819
3823
  *
3820
3824
  * @param options - Options for the list request
3821
3825
  * - `includeMembers` - Whether to include members in the response (default: true)
3826
+ * - `organizationId` - ID of the organization to fetch projects for
3822
3827
  */
3823
- list(options?: {includeMembers?: true}): Promise<SanityProject[]>
3824
- list(options?: {includeMembers?: false}): Promise<Omit<SanityProject, 'members'>[]>
3828
+ list(options?: {includeMembers?: true; organizationId?: string}): Promise<SanityProject[]>
3829
+ list(options?: {
3830
+ includeMembers?: false
3831
+ organizationId?: string
3832
+ }): Promise<Omit<SanityProject, 'members'>[]>
3825
3833
  /**
3826
3834
  * Fetch a project by project ID
3827
3835
  *
@@ -2465,9 +2465,13 @@ export declare class ObservableProjectsClient {
2465
2465
  *
2466
2466
  * @param options - Options for the list request
2467
2467
  * - `includeMembers` - Whether to include members in the response (default: true)
2468
+ * - `organizationId` - ID of the organization to fetch projects for
2468
2469
  */
2469
- list(options?: {includeMembers?: true}): Observable<SanityProject[]>
2470
- list(options?: {includeMembers?: false}): Observable<Omit<SanityProject, 'members'>[]>
2470
+ list(options?: {includeMembers?: true; organizationId?: string}): Observable<SanityProject[]>
2471
+ list(options?: {
2472
+ includeMembers?: false
2473
+ organizationId?: string
2474
+ }): Observable<Omit<SanityProject, 'members'>[]>
2471
2475
  /**
2472
2476
  * Fetch a project by project ID
2473
2477
  *
@@ -3819,9 +3823,13 @@ export declare class ProjectsClient {
3819
3823
  *
3820
3824
  * @param options - Options for the list request
3821
3825
  * - `includeMembers` - Whether to include members in the response (default: true)
3826
+ * - `organizationId` - ID of the organization to fetch projects for
3822
3827
  */
3823
- list(options?: {includeMembers?: true}): Promise<SanityProject[]>
3824
- list(options?: {includeMembers?: false}): Promise<Omit<SanityProject, 'members'>[]>
3828
+ list(options?: {includeMembers?: true; organizationId?: string}): Promise<SanityProject[]>
3829
+ list(options?: {
3830
+ includeMembers?: false
3831
+ organizationId?: string
3832
+ }): Promise<Omit<SanityProject, 'members'>[]>
3825
3833
  /**
3826
3834
  * Fetch a project by project ID
3827
3835
  *
@@ -1607,8 +1607,8 @@ class ObservableProjectsClient {
1607
1607
  this.#client = client, this.#httpRequest = httpRequest;
1608
1608
  }
1609
1609
  list(options) {
1610
- const uri = options?.includeMembers === !1 ? "/projects?includeMembers=false" : "/projects";
1611
- return _request(this.#client, this.#httpRequest, { uri });
1610
+ const query = {}, uri = "/projects";
1611
+ return options?.includeMembers === !1 && (query.includeMembers = "false"), options?.organizationId && (query.organizationId = options.organizationId), _request(this.#client, this.#httpRequest, { uri, query });
1612
1612
  }
1613
1613
  /**
1614
1614
  * Fetch a project by project ID
@@ -1626,8 +1626,8 @@ class ProjectsClient {
1626
1626
  this.#client = client, this.#httpRequest = httpRequest;
1627
1627
  }
1628
1628
  list(options) {
1629
- const uri = options?.includeMembers === !1 ? "/projects?includeMembers=false" : "/projects";
1630
- return lastValueFrom(_request(this.#client, this.#httpRequest, { uri }));
1629
+ const query = {}, uri = "/projects";
1630
+ return options?.includeMembers === !1 && (query.includeMembers = "false"), options?.organizationId && (query.organizationId = options.organizationId), lastValueFrom(_request(this.#client, this.#httpRequest, { uri, query }));
1631
1631
  }
1632
1632
  /**
1633
1633
  * Fetch a project by project ID