@scalar/workspace-store 0.46.1 → 0.46.2
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/resolve-request-factory-url.d.ts.map +1 -1
- package/dist/request-example/builder/resolve-request-factory-url.js +2 -1
- package/dist/request-example/context/security/extract-security-scheme-secrets.d.ts.map +1 -1
- package/dist/request-example/context/security/extract-security-scheme-secrets.js +11 -5
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @scalar/workspace-store
|
|
2
2
|
|
|
3
|
+
## 0.46.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#8927](https://github.com/scalar/scalar/pull/8927): Resolve environment variables in raw request paths when building request URLs, so address bar placeholders like `{{path}}` are substituted during send.
|
|
8
|
+
|
|
3
9
|
## 0.46.1
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-request-factory-url.d.ts","sourceRoot":"","sources":["../../../src/request-example/builder/resolve-request-factory-url.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAA;AAE/E;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,GACnC,SAAS,cAAc,EACvB,SAAS;IACP,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC,CAAA;IACzE,mBAAmB,EAAE,eAAe,CAAA;CACrC,KACA,
|
|
1
|
+
{"version":3,"file":"resolve-request-factory-url.d.ts","sourceRoot":"","sources":["../../../src/request-example/builder/resolve-request-factory-url.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAA;AAE/E;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,GACnC,SAAS,cAAc,EACvB,SAAS;IACP,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC,CAAA;IACzE,mBAAmB,EAAE,eAAe,CAAA;CACrC,KACA,MAkCF,CAAA"}
|
|
@@ -12,7 +12,8 @@ export const resolveRequestFactoryUrl = (request, options) => {
|
|
|
12
12
|
encodeURIComponent(replaceEnvVariables(value, variables)),
|
|
13
13
|
]));
|
|
14
14
|
const baseUrl = replaceEnvVariables(request.baseUrl, variables);
|
|
15
|
-
const
|
|
15
|
+
const rawPath = replaceEnvVariables(request.path.raw, variables);
|
|
16
|
+
const path = replacePathVariables(rawPath, pathVariables);
|
|
16
17
|
const mergedUrl = mergeUrls(baseUrl, path);
|
|
17
18
|
// When rendered inside an iframe with srcdoc, the browser reports
|
|
18
19
|
// window.location.origin as the string "null" instead of a real origin.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract-security-scheme-secrets.d.ts","sourceRoot":"","sources":["../../../../src/request-example/context/security/extract-security-scheme-secrets.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,KAAK,EAAE,SAAS,EAA2C,MAAM,uCAAuC,CAAA;AAC/G,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iDAAiD,CAAA;AAQlF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8DAA8D,CAAA;AAExG,OAAO,KAAK,EAUV,0BAA0B,EAC3B,MAAM,iDAAiD,CAAA;AAExD,wGAAwG;AACxG,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,GAAG,WAAW,CAAC,cAAc,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"extract-security-scheme-secrets.d.ts","sourceRoot":"","sources":["../../../../src/request-example/context/security/extract-security-scheme-secrets.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,KAAK,EAAE,SAAS,EAA2C,MAAM,uCAAuC,CAAA;AAC/G,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iDAAiD,CAAA;AAQlF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8DAA8D,CAAA;AAExG,OAAO,KAAK,EAUV,0BAA0B,EAC3B,MAAM,iDAAiD,CAAA;AAExD,wGAAwG;AACxG,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,GAAG,WAAW,CAAC,cAAc,CAAC,CAAA;AAiLjF,6DAA6D;AAC7D,eAAO,MAAM,4BAA4B,GAEvC,QAAQ,oBAAoB,GAAG,WAAW,CAAC,cAAc,CAAC,EAC1D,WAAW,SAAS,EACpB,MAAM,MAAM,EACZ,cAAc,MAAM,KACnB,0BA2DF,CAAA"}
|
|
@@ -15,11 +15,17 @@ const SECRET_TO_INPUT_FIELD_MAP = {
|
|
|
15
15
|
'x-scalar-secret-token-url': 'tokenUrl',
|
|
16
16
|
};
|
|
17
17
|
const mergeFlowSecrets = (properties, configSecrets, authStoreSecrets = {}) => Object.fromEntries(properties.map((property) => {
|
|
18
|
-
//
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
// Redirect URI is the only OAuth secret where an explicit empty value from
|
|
19
|
+
// store must be preserved. Other secrets use falsy fallback behavior for backwards-compatibility
|
|
20
|
+
// with config defaults when the casted auth store value is an empty string.
|
|
21
|
+
const authStoreValue = typeof authStoreSecrets[property] === 'string' ? authStoreSecrets[property] : undefined;
|
|
22
|
+
const configValue = typeof configSecrets[property] === 'string' ? configSecrets[property] : undefined;
|
|
23
|
+
const configInputValue = typeof configSecrets[SECRET_TO_INPUT_FIELD_MAP[property]] === 'string'
|
|
24
|
+
? configSecrets[SECRET_TO_INPUT_FIELD_MAP[property]]
|
|
25
|
+
: undefined;
|
|
26
|
+
const value = property === 'x-scalar-secret-redirect-uri'
|
|
27
|
+
? (authStoreValue ?? configValue ?? configInputValue ?? '')
|
|
28
|
+
: authStoreValue || configValue || configInputValue || '';
|
|
23
29
|
return [property, value];
|
|
24
30
|
}));
|
|
25
31
|
const extractRefreshTokenSecret = (authStoreSecrets = {}) => {
|
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"openapi",
|
|
17
17
|
"scalar"
|
|
18
18
|
],
|
|
19
|
-
"version": "0.46.
|
|
19
|
+
"version": "0.46.2",
|
|
20
20
|
"engines": {
|
|
21
21
|
"node": ">=22"
|
|
22
22
|
},
|
|
@@ -145,11 +145,11 @@
|
|
|
145
145
|
"vue": "^3.5.30",
|
|
146
146
|
"yaml": "^2.8.0",
|
|
147
147
|
"@scalar/helpers": "0.5.1",
|
|
148
|
-
"@scalar/openapi-upgrader": "0.2.5",
|
|
149
148
|
"@scalar/json-magic": "0.12.7",
|
|
149
|
+
"@scalar/openapi-upgrader": "0.2.6",
|
|
150
|
+
"@scalar/snippetz": "0.9.1",
|
|
150
151
|
"@scalar/types": "0.9.1",
|
|
151
|
-
"@scalar/validation": "0.3.0"
|
|
152
|
-
"@scalar/snippetz": "0.9.1"
|
|
152
|
+
"@scalar/validation": "0.3.0"
|
|
153
153
|
},
|
|
154
154
|
"devDependencies": {
|
|
155
155
|
"@google-cloud/storage": "7.16.0",
|