@scalar/workspace-store 0.46.2 → 0.46.3
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/CHANGELOG.md +6 -0
- package/dist/request-example/builder/header/build-request-cookie-header.d.ts.map +1 -1
- package/dist/request-example/builder/header/build-request-cookie-header.js +2 -1
- package/dist/request-example/builder/request-factory.d.ts.map +1 -1
- package/dist/request-example/builder/request-factory.js +2 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @scalar/workspace-store
|
|
2
2
|
|
|
3
|
+
## 0.46.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#8952](https://github.com/scalar/scalar/pull/8952): Export shared Scalar custom header constants from `@scalar/helpers/http/scalar-headers` and consume them in request build/send flows.
|
|
8
|
+
|
|
3
9
|
## 0.46.2
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-request-cookie-header.d.ts","sourceRoot":"","sources":["../../../../src/request-example/builder/header/build-request-cookie-header.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build-request-cookie-header.d.ts","sourceRoot":"","sources":["../../../../src/request-example/builder/header/build-request-cookie-header.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qEAAqE,CAAA;AAYxG;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,cAAc,aAAa,EAAE,EAAE,sBAAsB,MAAM,GAAG,SAAS,KAAG,MAWzG,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,wBAAwB,GAAI,gEAKtC;IACD,uEAAuE;IACvE,OAAO,EAAE,aAAa,EAAE,CAAA;IACxB,0EAA0E;IAC1E,oBAAoB,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAA;IAC/C,qEAAqE;IACrE,GAAG,EAAE,MAAM,CAAA;IACX;;;OAGG;IACH,qBAAqB,EAAE,OAAO,CAAA;CAC/B,KAAG,IAAI,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAsBvC,CAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { X_SCALAR_COOKIE } from '@scalar/helpers/http/scalar-headers';
|
|
1
2
|
import { filterGlobalCookie } from './filter-global-cookies.js';
|
|
2
3
|
const CUSTOM_COOKIE_HEADER_WARNING = "We're using a `X-Scalar-Cookie` custom header to the request. The proxy will forward this as a `Cookie` header. We do this to avoid the browser omitting the `Cookie` header for cross-origin requests for security reasons.";
|
|
3
4
|
const COOKIE_HEADER_WARNING = `We're trying to add a Cookie header, but browsers often omit them for cross-origin requests for various security reasons. If it's not working, that's probably why. Here are the requirements for it to work:
|
|
@@ -29,7 +30,7 @@ export const buildRequestCookieHeader = ({ cookies, originalCookieHeader, url, u
|
|
|
29
30
|
// Add a custom header for the proxy (that's then forwarded as `Cookie`)
|
|
30
31
|
if (useCustomCookieHeader) {
|
|
31
32
|
console.warn(CUSTOM_COOKIE_HEADER_WARNING);
|
|
32
|
-
return { name:
|
|
33
|
+
return { name: X_SCALAR_COOKIE, value: cookieHeader };
|
|
33
34
|
}
|
|
34
35
|
// or stick to the original header (which might be removed by the browser)
|
|
35
36
|
console.warn(COOKIE_HEADER_WARNING);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-factory.d.ts","sourceRoot":"","sources":["../../../src/request-example/builder/request-factory.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"request-factory.d.ts","sourceRoot":"","sources":["../../../src/request-example/builder/request-factory.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qEAAqE,CAAA;AACxG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DA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ACzB,CAAC,CAAA;CACH,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,GAAI,kKAY5B,kBAAkB,GAAG;IACtB,2BAA2B;IAC3B,SAAS,EAAE,eAAe,CAAA;IAC1B,8CAA8C;IAC9C,WAAW,EAAE,kBAAkB,CAAA;IAC/B,mCAAmC;IACnC,aAAa,EAAE,aAAa,EAAE,CAAA;IAC9B,oDAAoD;IACpD,QAAQ,EAAE,MAAM,CAAA;IAChB,wBAAwB;IACxB,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,sBAAsB;IACtB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACtC,qEAAqE;IACrE,UAAU,EAAE,OAAO,CAAA;IACnB,8DAA8D;IAC9D,uBAAuB,EAAE,0BAA0B,EAAE,CAAA;IACrD,sEAAsE;IACtE,+BAA+B,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACzD,KAAG;IACF,OAAO,EAAE,cAAc,CAAA;CAyExB,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { canMethodHaveBody } from '@scalar/helpers/http/can-method-have-body';
|
|
2
|
+
import { X_SCALAR_USER_AGENT } from '@scalar/helpers/http/scalar-headers';
|
|
2
3
|
import { replacePathVariables } from '@scalar/helpers/regex/replace-variables';
|
|
3
4
|
import { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref';
|
|
4
5
|
import { getServerVariables } from '../../request-example/builder/helpers/get-server-variables.js';
|
|
@@ -30,7 +31,7 @@ export const requestFactory = ({ exampleName, globalCookies, method, operation,
|
|
|
30
31
|
// that's then forwarded as a `User-Agent` header.
|
|
31
32
|
const userAgentHeader = headers.get('User-Agent');
|
|
32
33
|
if (isElectron && userAgentHeader) {
|
|
33
|
-
headers.set(
|
|
34
|
+
headers.set(X_SCALAR_USER_AGENT, userAgentHeader);
|
|
34
35
|
}
|
|
35
36
|
const globalCookieFilter = operation['x-scalar-disable-parameters']?.['global-cookies']?.[exampleName] ?? {};
|
|
36
37
|
const cookiesList = [
|
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"openapi",
|
|
17
17
|
"scalar"
|
|
18
18
|
],
|
|
19
|
-
"version": "0.46.
|
|
19
|
+
"version": "0.46.3",
|
|
20
20
|
"engines": {
|
|
21
21
|
"node": ">=22"
|
|
22
22
|
},
|
|
@@ -144,12 +144,12 @@
|
|
|
144
144
|
"type-fest": "^5.3.1",
|
|
145
145
|
"vue": "^3.5.30",
|
|
146
146
|
"yaml": "^2.8.0",
|
|
147
|
-
"@scalar/
|
|
148
|
-
"@scalar/json-magic": "0.12.7",
|
|
147
|
+
"@scalar/json-magic": "0.12.8",
|
|
149
148
|
"@scalar/openapi-upgrader": "0.2.6",
|
|
150
|
-
"@scalar/snippetz": "0.9.
|
|
151
|
-
"@scalar/
|
|
152
|
-
"@scalar/validation": "0.3.0"
|
|
149
|
+
"@scalar/snippetz": "0.9.2",
|
|
150
|
+
"@scalar/helpers": "0.5.2",
|
|
151
|
+
"@scalar/validation": "0.3.0",
|
|
152
|
+
"@scalar/types": "0.9.2"
|
|
153
153
|
},
|
|
154
154
|
"devDependencies": {
|
|
155
155
|
"@google-cloud/storage": "7.16.0",
|