@sanity/client 7.18.0 → 7.20.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 +22 -2
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.d.cts +57 -24
- package/dist/index.browser.d.ts +57 -24
- package/dist/index.browser.js +22 -2
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +23 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +57 -24
- package/dist/index.d.ts +57 -24
- package/dist/index.js +23 -3
- package/dist/index.js.map +1 -1
- package/dist/media-library.cjs.map +1 -1
- package/dist/media-library.d.cts +27 -0
- package/dist/media-library.d.ts +27 -0
- package/dist/media-library.js.map +1 -1
- package/dist/stega.browser.d.cts +57 -24
- package/dist/stega.browser.d.ts +57 -24
- package/dist/stega.d.cts +57 -24
- package/dist/stega.d.ts +57 -24
- package/package.json +1 -1
- package/src/media-library.ts +1 -0
- package/src/projects/ProjectsClient.ts +37 -36
- package/src/types.ts +28 -0
- package/umd/sanityClient.js +22 -2
- package/umd/sanityClient.min.js +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1603,9 +1603,18 @@ class ObservableProjectsClient {
|
|
|
1603
1603
|
constructor(client, httpRequest) {
|
|
1604
1604
|
this.#client = client, this.#httpRequest = httpRequest;
|
|
1605
1605
|
}
|
|
1606
|
+
/**
|
|
1607
|
+
* Fetch a list of projects the authenticated user has access to.
|
|
1608
|
+
*
|
|
1609
|
+
* @param options - Options for the list request
|
|
1610
|
+
* - `includeMembers` - Whether to include members in the response (default: true)
|
|
1611
|
+
* - `includeFeatures` - Whether to include features in the response (default: true)
|
|
1612
|
+
* - `organizationId` - ID of the organization to fetch projects for
|
|
1613
|
+
* - `onlyExplicitMembership` - Whether to include only projects with explicit membership (default: false)
|
|
1614
|
+
*/
|
|
1606
1615
|
list(options) {
|
|
1607
1616
|
const query = {}, uri = "/projects";
|
|
1608
|
-
return options?.includeMembers === !1 && (query.includeMembers = "false"), options?.organizationId && (query.organizationId = options.organizationId), options?.onlyExplicitMembership
|
|
1617
|
+
return options?.includeMembers === !1 && (query.includeMembers = "false"), options?.includeFeatures === !1 && (query.includeFeatures = "false"), options?.organizationId && (query.organizationId = options.organizationId), options?.onlyExplicitMembership && (query.onlyExplicitMembership = "true"), _request(this.#client, this.#httpRequest, { uri, query });
|
|
1609
1618
|
}
|
|
1610
1619
|
/**
|
|
1611
1620
|
* Fetch a project by project ID
|
|
@@ -1622,9 +1631,20 @@ class ProjectsClient {
|
|
|
1622
1631
|
constructor(client, httpRequest) {
|
|
1623
1632
|
this.#client = client, this.#httpRequest = httpRequest;
|
|
1624
1633
|
}
|
|
1634
|
+
/**
|
|
1635
|
+
* Fetch a list of projects the authenticated user has access to.
|
|
1636
|
+
*
|
|
1637
|
+
* @param options - Options for the list request
|
|
1638
|
+
* - `includeMembers` - Whether to include members in the response (default: true)
|
|
1639
|
+
* - `includeFeatures` - Whether to include features in the response (default: true)
|
|
1640
|
+
* - `organizationId` - ID of the organization to fetch projects for
|
|
1641
|
+
* - `onlyExplicitMembership` - Whether to include only projects with explicit membership (default: false)
|
|
1642
|
+
*/
|
|
1625
1643
|
list(options) {
|
|
1626
1644
|
const query = {}, uri = "/projects";
|
|
1627
|
-
return options?.includeMembers === !1 && (query.includeMembers = "false"), options?.organizationId && (query.organizationId = options.organizationId), options?.onlyExplicitMembership
|
|
1645
|
+
return options?.includeMembers === !1 && (query.includeMembers = "false"), options?.includeFeatures === !1 && (query.includeFeatures = "false"), options?.organizationId && (query.organizationId = options.organizationId), options?.onlyExplicitMembership && (query.onlyExplicitMembership = "true"), rxjs.lastValueFrom(
|
|
1646
|
+
_request(this.#client, this.#httpRequest, { uri, query })
|
|
1647
|
+
);
|
|
1628
1648
|
}
|
|
1629
1649
|
/**
|
|
1630
1650
|
* Fetch a project by project ID
|
|
@@ -2749,7 +2769,7 @@ function defineDeprecatedCreateClient(createClient2) {
|
|
|
2749
2769
|
return config.printNoDefaultExport(), createClient2(config$1);
|
|
2750
2770
|
};
|
|
2751
2771
|
}
|
|
2752
|
-
var name = "@sanity/client", version = "7.
|
|
2772
|
+
var name = "@sanity/client", version = "7.20.0";
|
|
2753
2773
|
const middleware = [
|
|
2754
2774
|
middleware$1.debug({ verbose: !0, namespace: "sanity:client" }),
|
|
2755
2775
|
middleware$1.headers({ "User-Agent": `${name} ${version}` }),
|