@sanity/client 6.2.0 → 6.3.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 +6 -10
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.js +6 -10
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +7 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +12 -4
- package/dist/index.js +7 -11
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/projects/ProjectsClient.ts +20 -8
- package/umd/sanityClient.js +6 -10
- package/umd/sanityClient.min.js +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -855,9 +855,13 @@ export declare class ObservableProjectsClient {
|
|
|
855
855
|
#private
|
|
856
856
|
constructor(client: ObservableSanityClient, httpRequest: HttpRequest)
|
|
857
857
|
/**
|
|
858
|
-
* Fetch a list of projects the authenticated user has access to
|
|
858
|
+
* Fetch a list of projects the authenticated user has access to.
|
|
859
|
+
*
|
|
860
|
+
* @param options - Options for the list request
|
|
861
|
+
* @param options.includeMembers - Whether to include members in the response (default: true)
|
|
859
862
|
*/
|
|
860
|
-
list(): Observable<SanityProject[]>
|
|
863
|
+
list(options?: {includeMembers?: true}): Observable<SanityProject[]>
|
|
864
|
+
list(options?: {includeMembers?: false}): Observable<Omit<SanityProject, 'members'>[]>
|
|
861
865
|
/**
|
|
862
866
|
* Fetch a project by project ID
|
|
863
867
|
*
|
|
@@ -1488,9 +1492,13 @@ export declare class ProjectsClient {
|
|
|
1488
1492
|
#private
|
|
1489
1493
|
constructor(client: SanityClient, httpRequest: HttpRequest)
|
|
1490
1494
|
/**
|
|
1491
|
-
* Fetch a list of projects the authenticated user has access to
|
|
1495
|
+
* Fetch a list of projects the authenticated user has access to.
|
|
1496
|
+
*
|
|
1497
|
+
* @param options - Options for the list request
|
|
1498
|
+
* @param options.includeMembers - Whether to include members in the response (default: true)
|
|
1492
1499
|
*/
|
|
1493
|
-
list(): Promise<SanityProject[]>
|
|
1500
|
+
list(options?: {includeMembers?: true}): Promise<SanityProject[]>
|
|
1501
|
+
list(options?: {includeMembers?: false}): Promise<Omit<SanityProject, 'members'>[]>
|
|
1494
1502
|
/**
|
|
1495
1503
|
* Fetch a project by project ID
|
|
1496
1504
|
*
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ export { adapter as unstable__adapter, environment as unstable__environment } fr
|
|
|
4
4
|
import { Observable, lastValueFrom } from 'rxjs';
|
|
5
5
|
import { map, filter } from 'rxjs/operators';
|
|
6
6
|
var name = "@sanity/client";
|
|
7
|
-
var version = "6.
|
|
7
|
+
var version = "6.3.0";
|
|
8
8
|
const middleware = [debug({
|
|
9
9
|
verbose: true,
|
|
10
10
|
namespace: "sanity:client"
|
|
@@ -1464,12 +1464,10 @@ class ObservableProjectsClient {
|
|
|
1464
1464
|
__privateSet$2(this, _client$1, client);
|
|
1465
1465
|
__privateSet$2(this, _httpRequest$2, httpRequest);
|
|
1466
1466
|
}
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
*/
|
|
1470
|
-
list() {
|
|
1467
|
+
list(options) {
|
|
1468
|
+
const uri = (options == null ? void 0 : options.includeMembers) === false ? "/projects?includeMembers=false" : "/projects";
|
|
1471
1469
|
return _request(__privateGet$2(this, _client$1), __privateGet$2(this, _httpRequest$2), {
|
|
1472
|
-
uri
|
|
1470
|
+
uri
|
|
1473
1471
|
});
|
|
1474
1472
|
}
|
|
1475
1473
|
/**
|
|
@@ -1492,12 +1490,10 @@ class ProjectsClient {
|
|
|
1492
1490
|
__privateSet$2(this, _client2$1, client);
|
|
1493
1491
|
__privateSet$2(this, _httpRequest2$2, httpRequest);
|
|
1494
1492
|
}
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
*/
|
|
1498
|
-
list() {
|
|
1493
|
+
list(options) {
|
|
1494
|
+
const uri = (options == null ? void 0 : options.includeMembers) === false ? "/projects?includeMembers=false" : "/projects";
|
|
1499
1495
|
return lastValueFrom(_request(__privateGet$2(this, _client2$1), __privateGet$2(this, _httpRequest2$2), {
|
|
1500
|
-
uri
|
|
1496
|
+
uri
|
|
1501
1497
|
}));
|
|
1502
1498
|
}
|
|
1503
1499
|
/**
|