@sanity/client 6.24.0 → 6.24.1
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 +3 -2
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.d.cts +3 -1
- package/dist/index.browser.d.ts +3 -1
- package/dist/index.browser.js +3 -2
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +4 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/config.ts +3 -1
- package/umd/sanityClient.js +3 -2
- package/umd/sanityClient.min.js +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -3143,7 +3143,9 @@ export declare class UsersClient {
|
|
|
3143
3143
|
/**
|
|
3144
3144
|
* @internal - it may have breaking changes in any release
|
|
3145
3145
|
*/
|
|
3146
|
-
export declare
|
|
3146
|
+
export declare function validateApiPerspective(
|
|
3147
|
+
perspective: unknown,
|
|
3148
|
+
): asserts perspective is ClientPerspective
|
|
3147
3149
|
|
|
3148
3150
|
/**
|
|
3149
3151
|
* The listener has been established, and will start receiving events.
|
package/dist/index.d.ts
CHANGED
|
@@ -3143,7 +3143,9 @@ export declare class UsersClient {
|
|
|
3143
3143
|
/**
|
|
3144
3144
|
* @internal - it may have breaking changes in any release
|
|
3145
3145
|
*/
|
|
3146
|
-
export declare
|
|
3146
|
+
export declare function validateApiPerspective(
|
|
3147
|
+
perspective: unknown,
|
|
3148
|
+
): asserts perspective is ClientPerspective
|
|
3147
3149
|
|
|
3148
3150
|
/**
|
|
3149
3151
|
* The listener has been established, and will start receiving events.
|
package/dist/index.js
CHANGED
|
@@ -191,7 +191,7 @@ function validateApiVersion(apiVersion) {
|
|
|
191
191
|
if (!(/^\d{4}-\d{2}-\d{2}$/.test(apiVersion) && apiDate instanceof Date && apiDate.getTime() > 0))
|
|
192
192
|
throw new Error("Invalid API version string, expected `1` or date in format `YYYY-MM-DD`");
|
|
193
193
|
}
|
|
194
|
-
|
|
194
|
+
function validateApiPerspective(perspective) {
|
|
195
195
|
if (Array.isArray(perspective)) {
|
|
196
196
|
for (const perspectiveValue of perspective)
|
|
197
197
|
if (perspectiveValue !== "published" && perspectiveValue !== "drafts" && !(typeof perspectiveValue == "string" && perspectiveValue.startsWith("r") && perspectiveValue !== "raw"))
|
|
@@ -211,7 +211,8 @@ const validateApiPerspective = function(perspective) {
|
|
|
211
211
|
"Invalid API perspective string, expected `published`, `previewDrafts` or `raw`"
|
|
212
212
|
);
|
|
213
213
|
}
|
|
214
|
-
}
|
|
214
|
+
}
|
|
215
|
+
const initConfig = (config, prevConfig) => {
|
|
215
216
|
const specifiedConfig = {
|
|
216
217
|
...prevConfig,
|
|
217
218
|
...config,
|
|
@@ -1564,7 +1565,7 @@ function defineDeprecatedCreateClient(createClient2) {
|
|
|
1564
1565
|
return printNoDefaultExport(), createClient2(config);
|
|
1565
1566
|
};
|
|
1566
1567
|
}
|
|
1567
|
-
var name = "@sanity/client", version = "6.24.
|
|
1568
|
+
var name = "@sanity/client", version = "6.24.1";
|
|
1568
1569
|
const middleware = [
|
|
1569
1570
|
debug({ verbose: !0, namespace: "sanity:client" }),
|
|
1570
1571
|
headers({ "User-Agent": `${name} ${version}` }),
|