@sanity/client 7.8.2 → 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/README.md +1 -1
- package/dist/index.browser.cjs +16 -12
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.d.cts +16 -4
- package/dist/index.browser.d.ts +16 -4
- package/dist/index.browser.js +16 -12
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +17 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -4
- package/dist/index.d.ts +16 -4
- package/dist/index.js +17 -13
- package/dist/index.js.map +1 -1
- package/dist/stega.browser.d.cts +16 -4
- package/dist/stega.browser.d.ts +16 -4
- package/dist/stega.d.cts +16 -4
- package/dist/stega.d.ts +16 -4
- package/package.json +1 -1
- package/src/datasets/DatasetsClient.ts +18 -2
- package/src/projects/ProjectsClient.ts +36 -14
- package/src/types.ts +4 -0
- package/umd/sanityClient.js +16 -12
- package/umd/sanityClient.min.js +2 -2
package/dist/index.browser.d.cts
CHANGED
|
@@ -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?: {
|
|
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?: {
|
|
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
|
*
|
|
@@ -4114,6 +4122,9 @@ export declare type ReleaseAction =
|
|
|
4114
4122
|
| UnscheduleReleaseAction
|
|
4115
4123
|
| DeleteReleaseAction
|
|
4116
4124
|
|
|
4125
|
+
/** @public */
|
|
4126
|
+
export declare type ReleaseCardinality = 'many' | 'one' | undefined
|
|
4127
|
+
|
|
4117
4128
|
/** @internal */
|
|
4118
4129
|
export declare interface ReleaseDocument extends SanityDocument {
|
|
4119
4130
|
/**
|
|
@@ -4150,6 +4161,7 @@ export declare interface ReleaseDocument extends SanityDocument {
|
|
|
4150
4161
|
description?: string
|
|
4151
4162
|
intendedPublishAt?: string
|
|
4152
4163
|
releaseType: ReleaseType
|
|
4164
|
+
cardinality?: ReleaseCardinality
|
|
4153
4165
|
}
|
|
4154
4166
|
}
|
|
4155
4167
|
|
package/dist/index.browser.d.ts
CHANGED
|
@@ -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?: {
|
|
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?: {
|
|
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
|
*
|
|
@@ -4114,6 +4122,9 @@ export declare type ReleaseAction =
|
|
|
4114
4122
|
| UnscheduleReleaseAction
|
|
4115
4123
|
| DeleteReleaseAction
|
|
4116
4124
|
|
|
4125
|
+
/** @public */
|
|
4126
|
+
export declare type ReleaseCardinality = 'many' | 'one' | undefined
|
|
4127
|
+
|
|
4117
4128
|
/** @internal */
|
|
4118
4129
|
export declare interface ReleaseDocument extends SanityDocument {
|
|
4119
4130
|
/**
|
|
@@ -4150,6 +4161,7 @@ export declare interface ReleaseDocument extends SanityDocument {
|
|
|
4150
4161
|
description?: string
|
|
4151
4162
|
intendedPublishAt?: string
|
|
4152
4163
|
releaseType: ReleaseType
|
|
4164
|
+
cardinality?: ReleaseCardinality
|
|
4153
4165
|
}
|
|
4154
4166
|
}
|
|
4155
4167
|
|
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,9 +1607,8 @@ class ObservableProjectsClient {
|
|
|
1601
1607
|
this.#client = client, this.#httpRequest = httpRequest;
|
|
1602
1608
|
}
|
|
1603
1609
|
list(options) {
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
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 });
|
|
1607
1612
|
}
|
|
1608
1613
|
/**
|
|
1609
1614
|
* Fetch a project by project ID
|
|
@@ -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,9 +1626,8 @@ class ProjectsClient {
|
|
|
1621
1626
|
this.#client = client, this.#httpRequest = httpRequest;
|
|
1622
1627
|
}
|
|
1623
1628
|
list(options) {
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
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 }));
|
|
1627
1631
|
}
|
|
1628
1632
|
/**
|
|
1629
1633
|
* Fetch a project by project ID
|
|
@@ -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
|
}
|