@scalar/workspace-store 0.56.0 → 0.56.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/CHANGELOG.md +19 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +9 -0
- package/dist/mutators/operation/helpers/fetch-request-to-har.d.ts.map +1 -1
- package/dist/mutators/operation/helpers/fetch-request-to-har.js +7 -2
- package/dist/navigation/get-navigation-options.d.ts.map +1 -1
- package/dist/navigation/get-navigation-options.js +4 -1
- package/dist/request-example/builder/body/get-request-body-example.d.ts.map +1 -1
- package/dist/request-example/builder/body/get-request-body-example.js +4 -2
- package/package.json +12 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @scalar/workspace-store
|
|
2
2
|
|
|
3
|
+
## 0.56.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#9820](https://github.com/scalar/scalar/pull/9820): Cap concurrent external fetches while bundling a document, so documents that reference many external examples (`externalValue`) or references do not open an unbounded number of connections on load
|
|
8
|
+
- [#9826](https://github.com/scalar/scalar/pull/9826): fix: resolve relative request URLs against the current origin in `fetchRequestToHar`
|
|
9
|
+
|
|
10
|
+
A relative `proxyUrl` (e.g. `/api/scalar-proxy`) makes `redirectToProxy` return a relative URL, which `new URL()` could not parse, so every request threw `TypeError: Invalid URL` and never made it into history.
|
|
11
|
+
|
|
12
|
+
- [#9819](https://github.com/scalar/scalar/pull/9819): Fall back to a schema-generated request body when a selected example only has an unresolved `externalValue`, so the Test Request editor no longer shows an empty body
|
|
13
|
+
- [#9790](https://github.com/scalar/scalar/pull/9790): fix: keep dots in webhook navigation deep links
|
|
14
|
+
|
|
15
|
+
Webhook event names that use dots (for example `account_holder.created`) had the
|
|
16
|
+
dot dropped when building the navigation id, joining adjacent words into
|
|
17
|
+
`account-holdercreated`. Dots are now kept, producing `account-holder.created`.
|
|
18
|
+
|
|
19
|
+
Old deep links using the dropped-dot slug are redirected to the new slug, so
|
|
20
|
+
existing bookmarks keep resolving.
|
|
21
|
+
|
|
3
22
|
## 0.56.0
|
|
4
23
|
|
|
5
24
|
### Minor Changes
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,YAAY,EAAU,MAAM,2BAA2B,CAAA;AAErE,OAAO,EAAE,KAAK,UAAU,EAAe,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAQ7E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAI5C,OAAO,EAAE,KAAK,SAAS,EAAmB,MAAM,iBAAiB,CAAA;AACjE,OAAO,EAAE,KAAK,YAAY,EAAsB,MAAM,oBAAoB,CAAA;AAS1E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAA;AAY5E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAA;AAIrE,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,wCAAwC,CAAA;AAC/C,OAAO,KAAK,EACV,sBAAsB,EACtB,SAAS,EACT,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,aAAa,EACd,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAA;AAC/E,OAAO,KAAK,EAAE,eAAe,EAA6B,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,YAAY,EAAU,MAAM,2BAA2B,CAAA;AAErE,OAAO,EAAE,KAAK,UAAU,EAAe,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAQ7E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAI5C,OA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;AAGD,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAA"}
|
package/dist/client.js
CHANGED
|
@@ -30,6 +30,12 @@ import { isAsyncApiDocument, isOpenApiDocument } from './schemas/type-guards.js'
|
|
|
30
30
|
import { generateSchema } from './schemas/v3.1/openapi/index.js';
|
|
31
31
|
import { recursiveRef } from './schemas/v3.1/openapi/reference.js';
|
|
32
32
|
import { OpenAPIDocumentSchema as OpenAPIDocumentSchemaStrict, } from './schemas/v3.1/strict/openapi-document.js';
|
|
33
|
+
/**
|
|
34
|
+
* Maximum number of external references and example `externalValue`s fetched at once while bundling
|
|
35
|
+
* a document. Keeps large documents (which can reference thousands of external examples) from opening
|
|
36
|
+
* an unbounded number of connections on load.
|
|
37
|
+
*/
|
|
38
|
+
const EXTERNAL_FETCH_CONCURRENCY_LIMIT = 10;
|
|
33
39
|
/**
|
|
34
40
|
* Resolves a workspace document from various input sources (URL, local file, or direct document object).
|
|
35
41
|
*
|
|
@@ -450,6 +456,9 @@ export const createWorkspaceStore = (workspaceProps) => {
|
|
|
450
456
|
const loaders = [
|
|
451
457
|
fetchUrls({
|
|
452
458
|
fetch: extraDocumentConfigurations[name]?.fetch ?? workspaceProps?.fetch,
|
|
459
|
+
// Cap concurrent fetches so a document with many external references or example
|
|
460
|
+
// `externalValue`s (potentially thousands) does not flood the network on load.
|
|
461
|
+
limit: EXTERNAL_FETCH_CONCURRENCY_LIMIT,
|
|
453
462
|
}),
|
|
454
463
|
];
|
|
455
464
|
// If a file loader plugin is provided, use it to resolve local file references
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch-request-to-har.d.ts","sourceRoot":"","sources":["../../../../src/mutators/operation/helpers/fetch-request-to-har.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAA;AAE7E,KAAK,sBAAsB,GAAG;IAC5B,2EAA2E;IAC3E,cAAc,EAAE,cAAc,CAAA;IAC9B;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,iBAAiB,GAAU,8DAKrC,sBAAsB,KAAG,OAAO,CAAC,UAAU,
|
|
1
|
+
{"version":3,"file":"fetch-request-to-har.d.ts","sourceRoot":"","sources":["../../../../src/mutators/operation/helpers/fetch-request-to-har.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAA;AAE7E,KAAK,sBAAsB,GAAG;IAC5B,2EAA2E;IAC3E,cAAc,EAAE,cAAc,CAAA;IAC9B;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,iBAAiB,GAAU,8DAKrC,sBAAsB,KAAG,OAAO,CAAC,UAAU,CAyD7C,CAAA"}
|
|
@@ -27,8 +27,13 @@
|
|
|
27
27
|
*/
|
|
28
28
|
export const fetchRequestToHar = async ({ requestPayload, includeBody = true, httpVersion = 'HTTP/1.1', bodySizeLimit = 1048576, }) => {
|
|
29
29
|
const [originalUrl, requestInit] = requestPayload;
|
|
30
|
-
//
|
|
31
|
-
|
|
30
|
+
// Resolve relative URLs (e.g. a relative proxy URL) so query params can be read.
|
|
31
|
+
// Absolute URLs ignore the base. The base only feeds param extraction — the
|
|
32
|
+
// original URL is preserved on the output — so fall back to a placeholder when
|
|
33
|
+
// there is no usable origin: non-browser envs (undefined) or opaque origins
|
|
34
|
+
// like sandboxed iframes / about:blank (the string "null").
|
|
35
|
+
const origin = globalThis.location?.origin;
|
|
36
|
+
const url = new URL(originalUrl, origin && origin !== 'null' ? origin : 'http://localhost');
|
|
32
37
|
// Extract the query strings from the URL
|
|
33
38
|
const queryString = Array.from(url.searchParams.entries()).map(([name, value]) => ({ name, value }));
|
|
34
39
|
// Normalize HeadersInit to a Headers instance so we can call .get() and .entries() safely
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-navigation-options.d.ts","sourceRoot":"","sources":["../../src/navigation/get-navigation-options.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,4BAA4B,EAAgC,MAAM,6BAA6B,CAAA;AAE7G,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAG7D,MAAM,MAAM,iBAAiB,GACzB,OAAO,CACL,IAAI,CACF,4BAA4B,EAC1B,qBAAqB,GACrB,iBAAiB,GACjB,uBAAuB,GACvB,qBAAqB,GACrB,mBAAmB,GACnB,kBAAkB,GAClB,YAAY,GACZ,YAAY,GACZ,oBAAoB,GACpB,sBAAsB,CACzB,CACF,GACD,SAAS,CAAA;AAEb;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAAI,cAAc,MAAM,EAAE,UAAU,iBAAiB,KAAG,
|
|
1
|
+
{"version":3,"file":"get-navigation-options.d.ts","sourceRoot":"","sources":["../../src/navigation/get-navigation-options.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,4BAA4B,EAAgC,MAAM,6BAA6B,CAAA;AAE7G,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAG7D,MAAM,MAAM,iBAAiB,GACzB,OAAO,CACL,IAAI,CACF,4BAA4B,EAC1B,qBAAqB,GACrB,iBAAiB,GACjB,uBAAuB,GACvB,qBAAqB,GACrB,mBAAmB,GACnB,kBAAkB,GAClB,YAAY,GACZ,YAAY,GACZ,oBAAoB,GACpB,sBAAsB,CACzB,CACF,GACD,SAAS,CAAA;AAEb;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAAI,cAAc,MAAM,EAAE,UAAU,iBAAiB,KAAG,mBAgJxF,CAAA"}
|
|
@@ -83,7 +83,10 @@ export const getNavigationOptions = (documentName, options) => {
|
|
|
83
83
|
method: props.method?.toUpperCase(),
|
|
84
84
|
})}`;
|
|
85
85
|
}
|
|
86
|
-
|
|
86
|
+
// Webhook events are commonly named with dots (e.g. "account_holder.created").
|
|
87
|
+
// Keep the dot so the deep link stays close to the event name, instead of
|
|
88
|
+
// dropping it and joining adjacent words ("account-holdercreated").
|
|
89
|
+
return `${prefixTag}webhook/${props.method?.toUpperCase()}/${slugify(props.name, { allowedSpecialChars: '.' })}`;
|
|
87
90
|
}
|
|
88
91
|
// -------- Default model id generation logic --------
|
|
89
92
|
if (props.type === 'model') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-request-body-example.d.ts","sourceRoot":"","sources":["../../../../src/request-example/builder/body/get-request-body-example.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,aAAa,EACb,iBAAiB,EAElB,MAAM,8DAA8D,CAAA;AAMrE;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAC7B,aAAa,iBAAiB,EAC9B,aAAa,MAAM,EACnB,aAAa,MAAM,EACnB,kCAAkC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KACvD,aAAa,GAAG,
|
|
1
|
+
{"version":3,"file":"get-request-body-example.d.ts","sourceRoot":"","sources":["../../../../src/request-example/builder/body/get-request-body-example.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,aAAa,EACb,iBAAiB,EAElB,MAAM,8DAA8D,CAAA;AAMrE;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAC7B,aAAa,iBAAiB,EAC9B,aAAa,MAAM,EACnB,aAAa,MAAM,EACnB,kCAAkC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KACvD,aAAa,GAAG,IAkClB,CAAA"}
|
|
@@ -7,9 +7,11 @@ import { getExampleFromSchema } from '../../../request-example/builder/helpers/g
|
|
|
7
7
|
*/
|
|
8
8
|
export const getExampleFromBody = (requestBody, contentType, exampleName, requestBodyCompositionSelection) => {
|
|
9
9
|
const content = requestBody.content?.[contentType];
|
|
10
|
-
// Return existing example value
|
|
10
|
+
// Return the existing example when it carries a usable value. An example that only has an
|
|
11
|
+
// `externalValue` (not yet resolved to a `value`) is treated as missing, so we fall back to a
|
|
12
|
+
// schema-generated example instead of building an empty request body.
|
|
11
13
|
const example = getExample(requestBody, exampleName, contentType);
|
|
12
|
-
if (example) {
|
|
14
|
+
if (example && example.value !== undefined) {
|
|
13
15
|
return example;
|
|
14
16
|
}
|
|
15
17
|
const schema = getResolvedRef(content?.schema);
|
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"openapi",
|
|
17
17
|
"scalar"
|
|
18
18
|
],
|
|
19
|
-
"version": "0.56.
|
|
19
|
+
"version": "0.56.1",
|
|
20
20
|
"engines": {
|
|
21
21
|
"node": ">=22"
|
|
22
22
|
},
|
|
@@ -146,23 +146,23 @@
|
|
|
146
146
|
"@scalar/typebox": "0.1.3",
|
|
147
147
|
"js-base64": "^3.7.8",
|
|
148
148
|
"type-fest": "^5.3.1",
|
|
149
|
-
"vue": "^3.5.
|
|
150
|
-
"yaml": "^2.
|
|
151
|
-
"@scalar/
|
|
152
|
-
"@scalar/
|
|
153
|
-
"@scalar/json-magic": "0.12.
|
|
154
|
-
"@scalar/openapi-upgrader": "0.2.
|
|
155
|
-
"@scalar/
|
|
156
|
-
"@scalar/
|
|
157
|
-
"@scalar/types": "0.17.
|
|
149
|
+
"vue": "^3.5.40",
|
|
150
|
+
"yaml": "^2.9.0",
|
|
151
|
+
"@scalar/asyncapi-upgrader": "0.1.5",
|
|
152
|
+
"@scalar/helpers": "0.10.0",
|
|
153
|
+
"@scalar/json-magic": "0.12.20",
|
|
154
|
+
"@scalar/openapi-upgrader": "0.2.13",
|
|
155
|
+
"@scalar/schemas": "0.8.1",
|
|
156
|
+
"@scalar/snippetz": "0.9.25",
|
|
157
|
+
"@scalar/types": "0.17.1",
|
|
158
158
|
"@scalar/validation": "0.6.2"
|
|
159
159
|
},
|
|
160
160
|
"devDependencies": {
|
|
161
161
|
"@google-cloud/storage": "7.16.0",
|
|
162
162
|
"fake-indexeddb": "6.2.3",
|
|
163
163
|
"fastify": "^5.8.1",
|
|
164
|
-
"vite": "8.
|
|
165
|
-
"vitest": "4.1.
|
|
164
|
+
"vite": "8.1.5",
|
|
165
|
+
"vitest": "4.1.10"
|
|
166
166
|
},
|
|
167
167
|
"scripts": {
|
|
168
168
|
"build": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
|