@sanity/client 7.5.0-live-cors.3 → 7.6.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 +7 -0
- package/dist/index.browser.cjs +3 -16
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.d.cts +32 -2
- package/dist/index.browser.d.ts +32 -2
- package/dist/index.browser.js +3 -16
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +4 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +32 -2
- package/dist/index.d.ts +32 -2
- package/dist/index.js +4 -17
- package/dist/index.js.map +1 -1
- package/dist/stega.browser.d.cts +32 -2
- package/dist/stega.browser.d.ts +32 -2
- package/dist/stega.d.cts +32 -2
- package/dist/stega.d.ts +32 -2
- package/package.json +1 -1
- package/src/agent/actions/transform.ts +32 -2
- package/src/data/live.ts +3 -23
- package/umd/sanityClient.js +3 -16
- package/umd/sanityClient.min.js +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1289,30 +1289,17 @@ class LiveClient {
|
|
|
1289
1289
|
}
|
|
1290
1290
|
return event;
|
|
1291
1291
|
})
|
|
1292
|
-
)
|
|
1293
|
-
console.log("YES THIS IS THE CORS VERSION with the allowed origin check");
|
|
1294
|
-
const isAllowedOrigin = (origin2) => [
|
|
1295
|
-
/^http:\/\/localhost:/,
|
|
1296
|
-
/^http:\/\/127\.0\.0\.1:/,
|
|
1297
|
-
/^https:\/\/[^.]*\.sanity\.studio$/,
|
|
1298
|
-
/^https:\/\/[^.]*\.studio\.sanity\.work$/,
|
|
1299
|
-
/^https:\/\/[^.]*\.sanity\.work$/,
|
|
1300
|
-
/^https:\/\/[^.]*\.sanity\.io$/
|
|
1301
|
-
].some((pattern) => pattern.test(origin2)), checkCors = fetchObservable(url, {
|
|
1292
|
+
), checkCors = fetchObservable(url, {
|
|
1302
1293
|
method: "OPTIONS",
|
|
1303
1294
|
mode: "cors",
|
|
1304
1295
|
credentials: esOptions.withCredentials ? "include" : "omit",
|
|
1305
|
-
headers:
|
|
1306
|
-
...esOptions.headers,
|
|
1307
|
-
"Access-Control-Request-Headers": "authorization"
|
|
1308
|
-
// for this preflight check, ensure we send what the browser would send if needed
|
|
1309
|
-
}
|
|
1296
|
+
headers: esOptions.headers
|
|
1310
1297
|
}).pipe(
|
|
1311
1298
|
rxjs.mergeMap(() => rxjs.EMPTY),
|
|
1312
1299
|
rxjs.catchError(() => {
|
|
1313
1300
|
throw new CorsOriginError({ projectId });
|
|
1314
1301
|
})
|
|
1315
|
-
),
|
|
1302
|
+
), observable = rxjs.concat(checkCors, events).pipe(
|
|
1316
1303
|
operators.finalize(() => eventsCache.delete(key)),
|
|
1317
1304
|
shareReplayLatest({
|
|
1318
1305
|
predicate: (event) => event.type === "welcome"
|
|
@@ -2537,7 +2524,7 @@ function defineDeprecatedCreateClient(createClient2) {
|
|
|
2537
2524
|
return config.printNoDefaultExport(), createClient2(config$1);
|
|
2538
2525
|
};
|
|
2539
2526
|
}
|
|
2540
|
-
var name = "@sanity/client", version = "7.
|
|
2527
|
+
var name = "@sanity/client", version = "7.6.0";
|
|
2541
2528
|
const middleware = [
|
|
2542
2529
|
middleware$1.debug({ verbose: !0, namespace: "sanity:client" }),
|
|
2543
2530
|
middleware$1.headers({ "User-Agent": `${name} ${version}` }),
|