@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.cjs
CHANGED
|
@@ -1380,8 +1380,11 @@ class ObservableDatasetsClient {
|
|
|
1380
1380
|
* Fetch a list of datasets for the configured project
|
|
1381
1381
|
*/
|
|
1382
1382
|
list() {
|
|
1383
|
-
|
|
1384
|
-
|
|
1383
|
+
config.resourceGuard("dataset", this.#client.config());
|
|
1384
|
+
const config$1 = this.#client.config(), projectId = config$1.projectId;
|
|
1385
|
+
let uri = "/datasets";
|
|
1386
|
+
return config$1.useProjectHostname === !1 && (uri = `/projects/${projectId}/datasets`), _request(this.#client, this.#httpRequest, {
|
|
1387
|
+
uri,
|
|
1385
1388
|
tag: null
|
|
1386
1389
|
});
|
|
1387
1390
|
}
|
|
@@ -1426,8 +1429,11 @@ class DatasetsClient {
|
|
|
1426
1429
|
* Fetch a list of datasets for the configured project
|
|
1427
1430
|
*/
|
|
1428
1431
|
list() {
|
|
1429
|
-
|
|
1430
|
-
|
|
1432
|
+
config.resourceGuard("dataset", this.#client.config());
|
|
1433
|
+
const config$1 = this.#client.config(), projectId = config$1.projectId;
|
|
1434
|
+
let uri = "/datasets";
|
|
1435
|
+
return config$1.useProjectHostname === !1 && (uri = `/projects/${projectId}/datasets`), rxjs.lastValueFrom(
|
|
1436
|
+
_request(this.#client, this.#httpRequest, { uri, tag: null })
|
|
1431
1437
|
);
|
|
1432
1438
|
}
|
|
1433
1439
|
}
|
|
@@ -1446,9 +1452,8 @@ class ObservableProjectsClient {
|
|
|
1446
1452
|
this.#client = client, this.#httpRequest = httpRequest;
|
|
1447
1453
|
}
|
|
1448
1454
|
list(options) {
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
return _request(this.#client, this.#httpRequest, { uri });
|
|
1455
|
+
const query = {}, uri = "/projects";
|
|
1456
|
+
return options?.includeMembers === !1 && (query.includeMembers = "false"), options?.organizationId && (query.organizationId = options.organizationId), _request(this.#client, this.#httpRequest, { uri, query });
|
|
1452
1457
|
}
|
|
1453
1458
|
/**
|
|
1454
1459
|
* Fetch a project by project ID
|
|
@@ -1456,7 +1461,7 @@ class ObservableProjectsClient {
|
|
|
1456
1461
|
* @param projectId - ID of the project to fetch
|
|
1457
1462
|
*/
|
|
1458
1463
|
getById(projectId) {
|
|
1459
|
-
return
|
|
1464
|
+
return _request(this.#client, this.#httpRequest, { uri: `/projects/${projectId}` });
|
|
1460
1465
|
}
|
|
1461
1466
|
}
|
|
1462
1467
|
class ProjectsClient {
|
|
@@ -1466,9 +1471,8 @@ class ProjectsClient {
|
|
|
1466
1471
|
this.#client = client, this.#httpRequest = httpRequest;
|
|
1467
1472
|
}
|
|
1468
1473
|
list(options) {
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
return rxjs.lastValueFrom(_request(this.#client, this.#httpRequest, { uri }));
|
|
1474
|
+
const query = {}, uri = "/projects";
|
|
1475
|
+
return options?.includeMembers === !1 && (query.includeMembers = "false"), options?.organizationId && (query.organizationId = options.organizationId), rxjs.lastValueFrom(_request(this.#client, this.#httpRequest, { uri, query }));
|
|
1472
1476
|
}
|
|
1473
1477
|
/**
|
|
1474
1478
|
* Fetch a project by project ID
|
|
@@ -1476,7 +1480,7 @@ class ProjectsClient {
|
|
|
1476
1480
|
* @param projectId - ID of the project to fetch
|
|
1477
1481
|
*/
|
|
1478
1482
|
getById(projectId) {
|
|
1479
|
-
return
|
|
1483
|
+
return rxjs.lastValueFrom(
|
|
1480
1484
|
_request(this.#client, this.#httpRequest, { uri: `/projects/${projectId}` })
|
|
1481
1485
|
);
|
|
1482
1486
|
}
|
|
@@ -2574,7 +2578,7 @@ function defineDeprecatedCreateClient(createClient2) {
|
|
|
2574
2578
|
return config.printNoDefaultExport(), createClient2(config$1);
|
|
2575
2579
|
};
|
|
2576
2580
|
}
|
|
2577
|
-
var name = "@sanity/client", version = "7.
|
|
2581
|
+
var name = "@sanity/client", version = "7.10.0";
|
|
2578
2582
|
const middleware = [
|
|
2579
2583
|
middleware$1.debug({ verbose: !0, namespace: "sanity:client" }),
|
|
2580
2584
|
middleware$1.headers({ "User-Agent": `${name} ${version}` }),
|