@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/README.md +1 -1
- package/dist/index.browser.cjs +12 -8
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.d.cts +4 -0
- package/dist/index.browser.d.ts +4 -0
- package/dist/index.browser.js +12 -8
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +13 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +13 -9
- package/dist/index.js.map +1 -1
- package/dist/stega.browser.d.cts +4 -0
- package/dist/stega.browser.d.ts +4 -0
- package/dist/stega.d.cts +4 -0
- package/dist/stega.d.ts +4 -0
- package/package.json +1 -1
- package/src/datasets/DatasetsClient.ts +18 -2
- package/src/projects/ProjectsClient.ts +0 -5
- package/src/types.ts +4 -0
- package/umd/sanityClient.js +12 -8
- package/umd/sanityClient.min.js +1 -1
package/dist/index.browser.d.cts
CHANGED
|
@@ -4114,6 +4114,9 @@ export declare type ReleaseAction =
|
|
|
4114
4114
|
| UnscheduleReleaseAction
|
|
4115
4115
|
| DeleteReleaseAction
|
|
4116
4116
|
|
|
4117
|
+
/** @public */
|
|
4118
|
+
export declare type ReleaseCardinality = 'many' | 'one' | undefined
|
|
4119
|
+
|
|
4117
4120
|
/** @internal */
|
|
4118
4121
|
export declare interface ReleaseDocument extends SanityDocument {
|
|
4119
4122
|
/**
|
|
@@ -4150,6 +4153,7 @@ export declare interface ReleaseDocument extends SanityDocument {
|
|
|
4150
4153
|
description?: string
|
|
4151
4154
|
intendedPublishAt?: string
|
|
4152
4155
|
releaseType: ReleaseType
|
|
4156
|
+
cardinality?: ReleaseCardinality
|
|
4153
4157
|
}
|
|
4154
4158
|
}
|
|
4155
4159
|
|
package/dist/index.browser.d.ts
CHANGED
|
@@ -4114,6 +4114,9 @@ export declare type ReleaseAction =
|
|
|
4114
4114
|
| UnscheduleReleaseAction
|
|
4115
4115
|
| DeleteReleaseAction
|
|
4116
4116
|
|
|
4117
|
+
/** @public */
|
|
4118
|
+
export declare type ReleaseCardinality = 'many' | 'one' | undefined
|
|
4119
|
+
|
|
4117
4120
|
/** @internal */
|
|
4118
4121
|
export declare interface ReleaseDocument extends SanityDocument {
|
|
4119
4122
|
/**
|
|
@@ -4150,6 +4153,7 @@ export declare interface ReleaseDocument extends SanityDocument {
|
|
|
4150
4153
|
description?: string
|
|
4151
4154
|
intendedPublishAt?: string
|
|
4152
4155
|
releaseType: ReleaseType
|
|
4156
|
+
cardinality?: ReleaseCardinality
|
|
4153
4157
|
}
|
|
4154
4158
|
}
|
|
4155
4159
|
|
package/dist/index.browser.js
CHANGED
|
@@ -1535,8 +1535,11 @@ class ObservableDatasetsClient {
|
|
|
1535
1535
|
* Fetch a list of datasets for the configured project
|
|
1536
1536
|
*/
|
|
1537
1537
|
list() {
|
|
1538
|
-
|
|
1539
|
-
|
|
1538
|
+
resourceGuard("dataset", this.#client.config());
|
|
1539
|
+
const config = this.#client.config(), projectId2 = config.projectId;
|
|
1540
|
+
let uri = "/datasets";
|
|
1541
|
+
return config.useProjectHostname === !1 && (uri = `/projects/${projectId2}/datasets`), _request(this.#client, this.#httpRequest, {
|
|
1542
|
+
uri,
|
|
1540
1543
|
tag: null
|
|
1541
1544
|
});
|
|
1542
1545
|
}
|
|
@@ -1581,8 +1584,11 @@ class DatasetsClient {
|
|
|
1581
1584
|
* Fetch a list of datasets for the configured project
|
|
1582
1585
|
*/
|
|
1583
1586
|
list() {
|
|
1584
|
-
|
|
1585
|
-
|
|
1587
|
+
resourceGuard("dataset", this.#client.config());
|
|
1588
|
+
const config = this.#client.config(), projectId2 = config.projectId;
|
|
1589
|
+
let uri = "/datasets";
|
|
1590
|
+
return config.useProjectHostname === !1 && (uri = `/projects/${projectId2}/datasets`), lastValueFrom(
|
|
1591
|
+
_request(this.#client, this.#httpRequest, { uri, tag: null })
|
|
1586
1592
|
);
|
|
1587
1593
|
}
|
|
1588
1594
|
}
|
|
@@ -1601,7 +1607,6 @@ class ObservableProjectsClient {
|
|
|
1601
1607
|
this.#client = client, this.#httpRequest = httpRequest;
|
|
1602
1608
|
}
|
|
1603
1609
|
list(options) {
|
|
1604
|
-
resourceGuard("projects", this.#client.config());
|
|
1605
1610
|
const uri = options?.includeMembers === !1 ? "/projects?includeMembers=false" : "/projects";
|
|
1606
1611
|
return _request(this.#client, this.#httpRequest, { uri });
|
|
1607
1612
|
}
|
|
@@ -1611,7 +1616,7 @@ class ObservableProjectsClient {
|
|
|
1611
1616
|
* @param projectId - ID of the project to fetch
|
|
1612
1617
|
*/
|
|
1613
1618
|
getById(projectId2) {
|
|
1614
|
-
return
|
|
1619
|
+
return _request(this.#client, this.#httpRequest, { uri: `/projects/${projectId2}` });
|
|
1615
1620
|
}
|
|
1616
1621
|
}
|
|
1617
1622
|
class ProjectsClient {
|
|
@@ -1621,7 +1626,6 @@ class ProjectsClient {
|
|
|
1621
1626
|
this.#client = client, this.#httpRequest = httpRequest;
|
|
1622
1627
|
}
|
|
1623
1628
|
list(options) {
|
|
1624
|
-
resourceGuard("projects", this.#client.config());
|
|
1625
1629
|
const uri = options?.includeMembers === !1 ? "/projects?includeMembers=false" : "/projects";
|
|
1626
1630
|
return lastValueFrom(_request(this.#client, this.#httpRequest, { uri }));
|
|
1627
1631
|
}
|
|
@@ -1631,7 +1635,7 @@ class ProjectsClient {
|
|
|
1631
1635
|
* @param projectId - ID of the project to fetch
|
|
1632
1636
|
*/
|
|
1633
1637
|
getById(projectId2) {
|
|
1634
|
-
return
|
|
1638
|
+
return lastValueFrom(
|
|
1635
1639
|
_request(this.#client, this.#httpRequest, { uri: `/projects/${projectId2}` })
|
|
1636
1640
|
);
|
|
1637
1641
|
}
|