@scalar/workspace-store 0.60.0 → 0.61.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/CHANGELOG.md +48 -0
- package/README.md +6 -0
- package/dist/channel-example/build-connection-url.d.ts.map +1 -1
- package/dist/channel-example/build-connection-url.js +3 -3
- package/dist/channel-example/dedupe-requirements.d.ts +1 -1
- package/dist/channel-example/get-async-api-protocols.js +2 -2
- package/dist/channel-example/get-asyncapi-security-requirements.d.ts +1 -1
- package/dist/channel-example/get-channel-connection-security.d.ts +1 -1
- package/dist/channel-example/get-channel-operations.d.ts.map +1 -1
- package/dist/channel-example/get-channel-operations.js +4 -1
- package/dist/channel-example/get-channel-parameters.d.ts.map +1 -1
- package/dist/channel-example/get-channel-parameters.js +3 -1
- package/dist/channel-example/resolve-channel.d.ts.map +1 -1
- package/dist/channel-example/resolve-channel.js +2 -0
- package/dist/channel-example/resolve-operation-channel.d.ts.map +1 -1
- package/dist/channel-example/resolve-operation-channel.js +4 -0
- package/dist/channel-example/resolve-operation-with-traits.js +2 -2
- package/dist/channel-example/servers.d.ts.map +1 -1
- package/dist/channel-example/servers.js +3 -1
- package/dist/channel-example/types.d.ts +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/client.js +3 -3
- package/dist/entities/auth/schema.d.ts +460 -20
- package/dist/entities/auth/schema.d.ts.map +1 -1
- package/dist/entities/auth/schema.js +2 -2
- package/dist/events/definitions/auth.d.ts +2 -2
- package/dist/events/definitions/document.d.ts +1 -1
- package/dist/events/definitions/operation.d.ts +3 -2
- package/dist/events/definitions/operation.d.ts.map +1 -1
- package/dist/events/definitions/server.d.ts +1 -1
- package/dist/events/old-definitions.d.ts +1 -1
- package/dist/helpers/create-chunk-writer.d.ts +6 -0
- package/dist/helpers/create-chunk-writer.d.ts.map +1 -0
- package/dist/helpers/create-chunk-writer.js +44 -0
- package/dist/helpers/dynamic-ref.d.ts +13 -2
- package/dist/helpers/dynamic-ref.d.ts.map +1 -1
- package/dist/helpers/dynamic-ref.js +20 -7
- package/dist/helpers/encode-chunk-name.d.ts +3 -0
- package/dist/helpers/encode-chunk-name.d.ts.map +1 -0
- package/dist/helpers/encode-chunk-name.js +9 -0
- package/dist/helpers/for-each-path-item-operation.d.ts +2 -2
- package/dist/helpers/get-first-server.d.ts +1 -1
- package/dist/helpers/get-resolved-ref.d.ts +6 -1
- package/dist/helpers/get-resolved-ref.d.ts.map +1 -1
- package/dist/helpers/get-resolved-ref.js +3 -10
- package/dist/helpers/is-non-optional-security-requirement.d.ts +1 -1
- package/dist/helpers/merge-object.d.ts +2 -2
- package/dist/helpers/merge-object.d.ts.map +1 -1
- package/dist/helpers/merge-object.js +2 -5
- package/dist/mutators/auth.d.ts +1 -1
- package/dist/mutators/auth.d.ts.map +1 -1
- package/dist/mutators/auth.js +9 -4
- package/dist/mutators/index.d.ts +10 -10
- package/dist/mutators/operation/body.js +2 -2
- package/dist/mutators/operation/helpers/fetch-request-to-har.d.ts.map +1 -1
- package/dist/mutators/operation/helpers/fetch-request-to-har.js +12 -2
- package/dist/mutators/operation/helpers/har-to-operation.d.ts +1 -1
- package/dist/mutators/operation/helpers/har-to-operation.d.ts.map +1 -1
- package/dist/mutators/operation/helpers/har-to-operation.js +9 -5
- package/dist/mutators/operation/helpers/sync-path-parameters.d.ts +2 -2
- package/dist/mutators/operation/history.js +2 -2
- package/dist/mutators/operation/operation.d.ts.map +1 -1
- package/dist/mutators/operation/operation.js +4 -0
- package/dist/mutators/operation/parameters.js +1 -1
- package/dist/mutators/server.d.ts +3 -3
- package/dist/mutators/server.js +1 -1
- package/dist/mutators/tag.d.ts.map +1 -1
- package/dist/mutators/tag.js +4 -0
- package/dist/navigation/helpers/get-openapi-object.d.ts +1 -1
- package/dist/navigation/helpers/traverse-asyncapi-document.d.ts.map +1 -1
- package/dist/navigation/helpers/traverse-asyncapi-document.js +2 -2
- package/dist/navigation/helpers/traverse-description.d.ts +1 -1
- package/dist/navigation/helpers/traverse-document.d.ts +1 -1
- package/dist/navigation/helpers/traverse-examples.d.ts +12 -1
- package/dist/navigation/helpers/traverse-examples.d.ts.map +1 -1
- package/dist/navigation/helpers/traverse-examples.js +22 -1
- package/dist/navigation/helpers/traverse-paths.d.ts +1 -1
- package/dist/navigation/helpers/traverse-schemas.d.ts +1 -1
- package/dist/navigation/helpers/traverse-tags.d.ts +1 -1
- package/dist/navigation/helpers/traverse-webhooks.d.ts +1 -1
- package/dist/navigation/helpers/update-order-ids.d.ts +2 -2
- package/dist/navigation/index.d.ts +1 -0
- package/dist/navigation/index.d.ts.map +1 -1
- package/dist/navigation/index.js +1 -0
- package/dist/navigation/types.d.ts +1 -1
- package/dist/persistence/index.d.ts.map +1 -1
- package/dist/persistence/index.js +10 -10
- package/dist/persistence/indexdb.d.ts.map +1 -1
- package/dist/persistence/indexdb.js +7 -5
- package/dist/persistence/migrations/v2-team-to-local.d.ts.map +1 -1
- package/dist/persistence/migrations/v2-team-to-local.js +3 -4
- package/dist/plugins/bundler/index.d.ts +5 -2
- package/dist/plugins/bundler/index.d.ts.map +1 -1
- package/dist/plugins/bundler/index.js +24 -26
- package/dist/request-example/builder/body/build-request-body.d.ts +2 -1
- package/dist/request-example/builder/body/build-request-body.d.ts.map +1 -1
- package/dist/request-example/builder/body/build-request-body.js +41 -5
- package/dist/request-example/builder/body/encode-multipart-body.d.ts +9 -0
- package/dist/request-example/builder/body/encode-multipart-body.d.ts.map +1 -0
- package/dist/request-example/builder/body/encode-multipart-body.js +29 -0
- package/dist/request-example/builder/body/get-request-body-example.d.ts +1 -1
- package/dist/request-example/builder/body/get-selected-body-content-type.d.ts +1 -1
- package/dist/request-example/builder/body/schema-value-coercion.d.ts +1 -1
- package/dist/request-example/builder/body/schema-value-coercion.js +1 -1
- package/dist/request-example/builder/body/serialize-form-property.d.ts +1 -1
- package/dist/request-example/builder/body/serialize-multipart-array.d.ts +16 -0
- package/dist/request-example/builder/body/serialize-multipart-array.d.ts.map +1 -0
- package/dist/request-example/builder/body/serialize-multipart-array.js +37 -0
- package/dist/request-example/builder/build-request.d.ts.map +1 -1
- package/dist/request-example/builder/build-request.js +12 -7
- package/dist/request-example/builder/header/build-request-parameters.d.ts +1 -1
- package/dist/request-example/builder/header/build-request-parameters.d.ts.map +1 -1
- package/dist/request-example/builder/header/build-request-parameters.js +7 -1
- package/dist/request-example/builder/header/de-serialize-parameter.d.ts +1 -1
- package/dist/request-example/builder/header/de-serialize-parameter.d.ts.map +1 -1
- package/dist/request-example/builder/header/de-serialize-parameter.js +2 -1
- package/dist/request-example/builder/header/is-param-disabled.d.ts +1 -1
- package/dist/request-example/builder/header/serialize-parameter.d.ts.map +1 -1
- package/dist/request-example/builder/header/serialize-parameter.js +13 -14
- package/dist/request-example/builder/helpers/get-example-from-schema.d.ts +9 -1
- package/dist/request-example/builder/helpers/get-example-from-schema.d.ts.map +1 -1
- package/dist/request-example/builder/helpers/get-example-from-schema.js +255 -20
- package/dist/request-example/builder/helpers/get-example.d.ts +1 -1
- package/dist/request-example/builder/helpers/get-example.js +2 -2
- package/dist/request-example/builder/helpers/get-resolved-url.d.ts +1 -1
- package/dist/request-example/builder/helpers/get-server-variables.d.ts +1 -1
- package/dist/request-example/builder/index.d.ts +1 -0
- package/dist/request-example/builder/index.d.ts.map +1 -1
- package/dist/request-example/builder/index.js +1 -0
- package/dist/request-example/builder/request-factory.d.ts +2 -2
- package/dist/request-example/builder/security/broker-scheme-types.d.ts.map +1 -1
- package/dist/request-example/builder/security/broker-scheme-types.js +2 -2
- package/dist/request-example/builder/security/build-request-security.d.ts.map +1 -1
- package/dist/request-example/builder/security/build-request-security.js +3 -4
- package/dist/request-example/builder/security/secret-types.d.ts +13 -4
- package/dist/request-example/builder/security/secret-types.d.ts.map +1 -1
- package/dist/request-example/context/get-request-example-context.d.ts +3 -3
- package/dist/request-example/context/get-request-example-context.js +1 -1
- package/dist/request-example/context/headers.d.ts +1 -1
- package/dist/request-example/context/headers.js +1 -1
- package/dist/request-example/context/helpers/combine-params.d.ts +1 -1
- package/dist/request-example/context/security/extract-security-scheme-secrets.d.ts +16 -3
- 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 +21 -19
- package/dist/request-example/context/security/get-security-requirements.d.ts +2 -2
- package/dist/request-example/context/security/get-security-schemes.d.ts +1 -1
- package/dist/request-example/context/security/get-selected-security.d.ts +1 -1
- package/dist/request-example/context/security/is-auth-optional.d.ts +1 -1
- package/dist/request-example/context/security/merge-security.d.ts +3 -3
- package/dist/request-example/context/security/merge-security.d.ts.map +1 -1
- package/dist/request-example/context/security/merge-security.js +40 -11
- package/dist/request-example/context/servers.d.ts +2 -2
- package/dist/request-example/functions.d.ts.map +1 -1
- package/dist/request-example/index.d.ts +1 -1
- package/dist/request-example/index.d.ts.map +1 -1
- package/dist/request-example/index.js +1 -1
- package/dist/resolve.d.ts +1 -1
- package/dist/resolve.js +1 -1
- package/dist/schemas/navigation.d.ts +4 -4
- package/dist/schemas/navigation.js +1 -1
- package/dist/schemas/reference-config/index.d.ts +92 -4
- package/dist/schemas/reference-config/index.d.ts.map +1 -1
- package/dist/schemas/reference-config/settings.d.ts +93 -5
- package/dist/schemas/reference-config/settings.d.ts.map +1 -1
- package/dist/schemas/reference-config/settings.js +1 -1
- package/dist/schemas/type-guards.d.ts +1 -1
- package/dist/schemas/v3.1/openapi/index.d.ts.map +1 -1
- package/dist/schemas/v3.1/openapi/index.js +11 -1
- package/dist/schemas/v3.1/strict/openapi-document.d.ts +210 -0
- package/dist/schemas/v3.1/strict/openapi-document.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/security-scheme.d.ts +13 -1
- package/dist/schemas/v3.1/strict/security-scheme.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/security-scheme.js +11 -1
- package/dist/schemas/v3.2/openapi/index.d.ts +2 -0
- package/dist/schemas/v3.2/openapi/index.d.ts.map +1 -1
- package/dist/schemas/v3.2/openapi/index.js +13 -1
- package/dist/schemas/v3.2/strict/oauth-flow.d.ts +23 -1
- package/dist/schemas/v3.2/strict/oauth-flow.d.ts.map +1 -1
- package/dist/schemas/v3.2/strict/oauth-flow.js +6 -1
- package/dist/schemas/v3.2/strict/oauthflows.d.ts +20 -0
- package/dist/schemas/v3.2/strict/oauthflows.d.ts.map +1 -1
- package/dist/schemas/v3.2/strict/openapi-document.d.ts +1439 -141
- package/dist/schemas/v3.2/strict/openapi-document.d.ts.map +1 -1
- package/dist/schemas/v3.2/strict/openapi-document.js +2 -1
- package/dist/schemas/v3.2/strict/security-scheme.d.ts +29 -6
- package/dist/schemas/v3.2/strict/security-scheme.d.ts.map +1 -1
- package/dist/schemas/v3.2/strict/security-scheme.js +16 -3
- package/dist/schemas/workspace-specification/index.d.ts +1 -1
- package/dist/schemas/workspace.d.ts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +23 -27
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,53 @@
|
|
|
1
1
|
# @scalar/workspace-store
|
|
2
2
|
|
|
3
|
+
## 0.61.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#10173](https://github.com/scalar/scalar/pull/10173): Support the OpenAPI 3.2 QUERY request method in workspace operations, navigation, server chunks, and request examples.
|
|
8
|
+
|
|
9
|
+
Give QUERY a dedicated color tuned to each theme preset in light and dark mode and place it after GET in the method picker. Server chunk extraction also recognizes uppercase method keys while retaining their authored case. QUERY is modeled in the 3.2 schemas only.
|
|
10
|
+
|
|
11
|
+
- [#9851](https://github.com/scalar/scalar/pull/9851): Validate and coerce OpenAPI documents against the v3.2 schemas so OpenAPI 3.2 fields are preserved in the store instead of being stripped, and type the store (workspace, documents, and navigation) against the v3.2 document. The internal upgrade target stays 3.1, but the public document type now widens to the 3.2 superset (for example `parameter.in` gains `"querystring"`, tags gain `parent`/`kind`/`summary`).
|
|
12
|
+
|
|
13
|
+
To keep the v3.2 schema a true superset of 3.1, the `x-scalar-ignore` extension is kept on security schemes (so they can still be hidden from the auth UI), and 3.2 `querystring` parameters are now serialized into the request query string instead of being dropped when building requests.
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [#9885](https://github.com/scalar/scalar/pull/9885): Render `$dynamicRef` array items when the binding schema is referenced by name.
|
|
18
|
+
A response that used `$ref: '#/components/schemas/PaginatedUserResponse'` (rather
|
|
19
|
+
than an inline `$id`/`$defs` binding) hid the resource's `$dynamicAnchor` behind
|
|
20
|
+
the `$ref`, so the dynamic scope never grew and the item type rendered empty.
|
|
21
|
+
`pushDynamicScope` now follows a bare `$ref` to reach the named binding resource.
|
|
22
|
+
- [#9817](https://github.com/scalar/scalar/pull/9817): Resolve relative `externalValue` URLs on example objects against the document origin, so external request and response examples load even when referenced with a relative path
|
|
23
|
+
- [#10068](https://github.com/scalar/scalar/pull/10068): Generate a proper UUID example for version-specific uuid formats (uuid1, uuid3, uuid4, uuid5), so documents from FastAPI/Pydantic get a UUID example instead of an empty one.
|
|
24
|
+
- [#10072](https://github.com/scalar/scalar/pull/10072): Add a "generate example from schema" button to the request body, so the schema-generated fields stay reachable once an operation ships custom examples
|
|
25
|
+
- [#10165](https://github.com/scalar/scalar/pull/10165): Truncate deeply nested examples with an empty value of the declared type — `{}`, `[]`, or a placeholder of the declared primitive — instead of the `[Max Depth Exceeded]` string, so a truncated example no longer contradicts the type its schema declares. A value the schema states outright through `example`, `examples`, `default`, `const` or `enum` wins at that depth, including through a composition wrapper; a property excluded by `mode` is omitted there rather than replaced by a placeholder; and a composition nothing can describe, or a negative constraint, answers with `null`. Only schemas that describe no shape at all keep the sentinel. A schema shared between a deep chain and a shallower position is also no longer served the truncated example.
|
|
26
|
+
- [#10164](https://github.com/scalar/scalar/pull/10164): Serve deprecated response schemas from the mock instead of answering a declared JSON response with an empty body, and generate a deprecated AsyncAPI message payload instead of sending `null`. `getExampleFromSchema` takes a new `includeDeprecated` option for callers that must produce a value satisfying the schema. A declared response header that generates no value is now skipped rather than clearing a header of the same name the mock already set, such as the CORS headers.
|
|
27
|
+
- [#10081](https://github.com/scalar/scalar/pull/10081): Keep the `mutualTLS` security scheme type instead of turning it into an apiKey form, and show read-only authentication guidance for mutual TLS and unsupported browser broker credentials.
|
|
28
|
+
- [#9666](https://github.com/scalar/scalar/pull/9666): Only normalize OpenAPI Reference Objects during bundling, never Schema Objects. `normalizeRefs` used to strip every sibling except `$ref` on any node outside `components/schemas`, which also hit inline schemas. In JSON Schema 2020-12 a `$ref` may legally carry sibling keywords — for example a `$defs`/`$dynamicAnchor` binding that specializes a generic template like `Paginated<T>` — and such schemas appear inline anywhere a schema is allowed (a response's `content.<media>.schema`, an `allOf` branch, …). Dropping those siblings discarded the binding, leaving `$dynamicRef` to resolve to the template's empty fallback and rendering an empty array (for example the `data` array of `GET /planets` in the Scalar Galaxy). Reference Objects are still normalized as before. A new `@scalar/helpers/openapi/is-schema-path` helper detects schema positions.
|
|
29
|
+
- [#9851](https://github.com/scalar/scalar/pull/9851): Preserve mutualTLS security schemes and the default request body view extension in OpenAPI 3.2 document schemas and types.
|
|
30
|
+
|
|
31
|
+
Render OpenAPI 3.2 querystring parameters in the query parameters section.
|
|
32
|
+
|
|
33
|
+
- [#10137](https://github.com/scalar/scalar/pull/10137): Skip Paths Object extension keys so they cannot be mistaken for API paths. Add a regression test with an operation-shaped extension.
|
|
34
|
+
- [#10114](https://github.com/scalar/scalar/pull/10114): Keep chunk filenames inside the output directory and match their references on Windows. Reject existing symlinks below the output root when writing chunks and the workspace manifest.
|
|
35
|
+
- [#10131](https://github.com/scalar/scalar/pull/10131): Copy the example shown in the response card, including named, generated, referenced, and falsy values.
|
|
36
|
+
- [#10194](https://github.com/scalar/scalar/pull/10194): Fix editing server variables supplied through the configuration.
|
|
37
|
+
- [#10140](https://github.com/scalar/scalar/pull/10140): Replace redundant type assertions with compiler-checked annotations, typed accumulators, and existing guards across helpers, API conversion, request handling, and schema rendering.
|
|
38
|
+
|
|
39
|
+
Narrow DOM elements and caught errors before accessing their properties. Correct header lookup to include missing values and handle them during PowerShell snippet generation.
|
|
40
|
+
|
|
41
|
+
Validate release-note provider responses, represent unresolved references and absent groups in helper return types, and require narrowing merged object values. Preserve AsyncAPI broker credentials separately from HTTP authentication schemes.
|
|
42
|
+
|
|
43
|
+
- [#10142](https://github.com/scalar/scalar/pull/10142): Send multipart array properties as separate parts with the same field name, applying encoding to each item. Preserve JSON item content types, uploaded files, and array values after form edits, and generate matching code snippets.
|
|
44
|
+
|
|
45
|
+
Send JSON form fields without an upload filename and preserve fields and files in request history.
|
|
46
|
+
|
|
47
|
+
Rename the RestSharp snippet's internal `getMethod` helper so it no longer clashes with the `getMethod` that Nitro bundles into server builds (the new multipart imports shifted chunking and surfaced the collision).
|
|
48
|
+
|
|
49
|
+
- [#10199](https://github.com/scalar/scalar/pull/10199): Honor OpenAPI discriminator `defaultMapping` when generating oneOf and anyOf examples with an absent or unmapped discriminating property. Preserve explicit variant selections and prefer explicit and implicit mappings before the fallback.
|
|
50
|
+
|
|
3
51
|
## 0.60.0
|
|
4
52
|
|
|
5
53
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -95,6 +95,12 @@ const chunk = store.get('#/document-name/components/schemas/Person')
|
|
|
95
95
|
|
|
96
96
|
Create a new store in static mode
|
|
97
97
|
|
|
98
|
+
Static generation treats the real path of the configured output directory as its trusted root,
|
|
99
|
+
so an intentionally symlinked output directory is supported. Existing symbolic links below that
|
|
100
|
+
root, including chunk files and `scalar-workspace.json`, are rejected. Keep the output directory
|
|
101
|
+
and its ancestors under trusted control throughout generation: filesystem checks do not protect
|
|
102
|
+
against an untrusted process concurrently replacing files or directories.
|
|
103
|
+
|
|
98
104
|
```ts
|
|
99
105
|
// Create the store
|
|
100
106
|
const store = await createServerWorkspaceStore({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-connection-url.d.ts","sourceRoot":"","sources":["../../src/channel-example/build-connection-url.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACpB,uBAAuB,EACxB,MAAM,4BAA4B,CAAA;AAInC,2FAA2F;AAC3F,eAAO,MAAM,4BAA4B,wBAAyB,CAAA;AAElE,MAAM,MAAM,yBAAyB,GAAG,CAAC,OAAO,4BAA4B,CAAC,CAAC,MAAM,CAAC,CAAA;AAErF,MAAM,MAAM,uBAAuB,GAAG;IACpC,MAAM,EAAE,oBAAoB,CAAA;IAC5B,OAAO,EAAE,qBAAqB,CAAA;IAC9B,SAAS,CAAC,EAAE,uBAAuB,GAAG,IAAI,CAAA;IAC1C,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACvC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACxC,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC,CAAA;CACjF,CAAA;AAQD;;GAEG;AACH,eAAO,MAAM,0BAA0B,GAAI,QAAQ,oBAAoB,GAAG,IAAI,KAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAYrG,CAAA;AAoBD;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAAI,UAAU,MAAM,GAAG,SAAS,KAAG,MAAM,GAAG,SAGzE,CAAA;AAED,yEAAyE;AACzE,eAAO,MAAM,wBAAwB,GAAI,UAAU,MAAM,KAAG,MAAuC,CAAA;AAEnG,eAAO,MAAM,mBAAmB,GAAI,UAAU,MAAM,KAAG,QAAQ,IAAI,
|
|
1
|
+
{"version":3,"file":"build-connection-url.d.ts","sourceRoot":"","sources":["../../src/channel-example/build-connection-url.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACpB,uBAAuB,EACxB,MAAM,4BAA4B,CAAA;AAInC,2FAA2F;AAC3F,eAAO,MAAM,4BAA4B,wBAAyB,CAAA;AAElE,MAAM,MAAM,yBAAyB,GAAG,CAAC,OAAO,4BAA4B,CAAC,CAAC,MAAM,CAAC,CAAA;AAErF,MAAM,MAAM,uBAAuB,GAAG;IACpC,MAAM,EAAE,oBAAoB,CAAA;IAC5B,OAAO,EAAE,qBAAqB,CAAA;IAC9B,SAAS,CAAC,EAAE,uBAAuB,GAAG,IAAI,CAAA;IAC1C,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACvC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACxC,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC,CAAA;CACjF,CAAA;AAQD;;GAEG;AACH,eAAO,MAAM,0BAA0B,GAAI,QAAQ,oBAAoB,GAAG,IAAI,KAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAYrG,CAAA;AAoBD;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAAI,UAAU,MAAM,GAAG,SAAS,KAAG,MAAM,GAAG,SAGzE,CAAA;AAED,yEAAyE;AACzE,eAAO,MAAM,wBAAwB,GAAI,UAAU,MAAM,KAAG,MAAuC,CAAA;AAEnG,eAAO,MAAM,mBAAmB,GAAI,UAAU,MAAM,KAAG,QAAQ,IAAI,yBACsB,CAAA;AAEzF;;GAEG;AACH,eAAO,MAAM,0BAA0B,GACrC,QAAQ,oBAAoB,EAC5B,uBAAuB,uBAAuB,CAAC,sBAAsB,CAAC,KACrE,MAYF,CAAA;AAaD,0FAA0F;AAC1F,eAAO,MAAM,eAAe,GAC1B,SAAS,qBAAqB,EAC9B,YAAY,uBAAuB,GAAG,IAAI,KACzC,uBAAuB,GAAG,SAa5B,CAAA;AA0FD;;;GAGG;AACH,eAAO,MAAM,kBAAkB,GAC7B,WAAW,uBAAuB,GAAG,SAAS,EAC9C,kBAAkB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KACvC,eAoBF,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB,GAAI,wFAOhC,uBAAuB,KAAG,MAkB5B,CAAA"}
|
|
@@ -14,7 +14,7 @@ export const getAsyncApiServerVariables = (server) => {
|
|
|
14
14
|
}
|
|
15
15
|
return objectEntries(server.variables).reduce((acc, [name, variable]) => {
|
|
16
16
|
const resolved = getResolvedRef(variable);
|
|
17
|
-
if (resolved
|
|
17
|
+
if (resolved?.default != null) {
|
|
18
18
|
acc[String(name)] = String(resolved.default);
|
|
19
19
|
}
|
|
20
20
|
return acc;
|
|
@@ -45,7 +45,7 @@ export const normalizeProtocol = (protocol) => {
|
|
|
45
45
|
};
|
|
46
46
|
/** Maps AsyncAPI `server.protocol` to a URL scheme (MVP: ws and wss). */
|
|
47
47
|
export const getUrlSchemeFromProtocol = (protocol) => protocol.trim().toLowerCase();
|
|
48
|
-
export const isWebSocketProtocol = (protocol) => ASYNCAPI_WEBSOCKET_PROTOCOLS.
|
|
48
|
+
export const isWebSocketProtocol = (protocol) => ASYNCAPI_WEBSOCKET_PROTOCOLS.some((scheme) => scheme === protocol.trim().toLowerCase());
|
|
49
49
|
/**
|
|
50
50
|
* Builds the server base URL: scheme, host, and optional pathname (no channel address).
|
|
51
51
|
*/
|
|
@@ -65,7 +65,7 @@ const resolveWsBinding = (bindings) => {
|
|
|
65
65
|
return undefined;
|
|
66
66
|
}
|
|
67
67
|
const resolved = getResolvedRef(bindings);
|
|
68
|
-
return resolved
|
|
68
|
+
return resolved?.ws;
|
|
69
69
|
};
|
|
70
70
|
/** Merges channel and operation WebSocket bindings; operation fields override channel. */
|
|
71
71
|
export const mergeWsBindings = (channel, operation) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SecurityRequirementObject } from '../schemas/v3.
|
|
1
|
+
import type { SecurityRequirementObject } from '../schemas/v3.2/strict/security-requirement.js';
|
|
2
2
|
/**
|
|
3
3
|
* Remove duplicate security requirements, comparing by their JSON shape.
|
|
4
4
|
*
|
|
@@ -13,7 +13,7 @@ export const ALL = 'all';
|
|
|
13
13
|
const getServerProtocols = (document) => {
|
|
14
14
|
const protocols = new Map();
|
|
15
15
|
for (const [name, serverNode] of objectEntries(document.servers ?? {})) {
|
|
16
|
-
const protocol = normalizeProtocol(getResolvedRef(serverNode)
|
|
16
|
+
const protocol = normalizeProtocol(getResolvedRef(serverNode)?.protocol);
|
|
17
17
|
if (protocol) {
|
|
18
18
|
protocols.set(name, protocol);
|
|
19
19
|
}
|
|
@@ -43,7 +43,7 @@ export const getAsyncApiProtocols = (document) => {
|
|
|
43
43
|
*/
|
|
44
44
|
export const getAsyncApiServerOptions = (document) => {
|
|
45
45
|
const options = objectEntries(document.servers ?? {}).map(([name, serverNode]) => {
|
|
46
|
-
const protocol = normalizeProtocol(getResolvedRef(serverNode)
|
|
46
|
+
const protocol = normalizeProtocol(getResolvedRef(serverNode)?.protocol);
|
|
47
47
|
return { id: name, label: protocol ? `${name} (${protocol})` : name };
|
|
48
48
|
});
|
|
49
49
|
return [{ id: ALL, label: 'All servers' }, ...options];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AsyncApiDocument, AsyncApiOperationObject, AsyncApiServerObject } from '@scalar/types/asyncapi/3.1';
|
|
2
|
-
import type { SecurityRequirementObject } from '../schemas/v3.
|
|
2
|
+
import type { SecurityRequirementObject } from '../schemas/v3.2/strict/security-requirement.js';
|
|
3
3
|
/**
|
|
4
4
|
* Converts AsyncAPI security arrays (operation, traits, server) into OpenAPI-style requirement objects.
|
|
5
5
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AsyncApiChannelObject, AsyncApiDocument, AsyncApiServerObject } from '@scalar/types/asyncapi/3.1';
|
|
2
|
-
import type { SecurityRequirementObject } from '../schemas/v3.
|
|
2
|
+
import type { SecurityRequirementObject } from '../schemas/v3.2/strict/security-requirement.js';
|
|
3
3
|
import type { ChannelOperationSummary } from './get-channel-operations.js';
|
|
4
4
|
/**
|
|
5
5
|
* Merges security requirements from the selected server and all operations on a channel.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-channel-operations.d.ts","sourceRoot":"","sources":["../../src/channel-example/get-channel-operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAA;AAO3F,MAAM,MAAM,uBAAuB,GAAG;IACpC,aAAa,EAAE,MAAM,CAAA;IACrB,SAAS,EAAE,uBAAuB,CAAA;IAClC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;CAC3B,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAAI,UAAU,gBAAgB,EAAE,aAAa,MAAM,KAAG,uBAAuB,
|
|
1
|
+
{"version":3,"file":"get-channel-operations.d.ts","sourceRoot":"","sources":["../../src/channel-example/get-channel-operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAA;AAO3F,MAAM,MAAM,uBAAuB,GAAG;IACpC,aAAa,EAAE,MAAM,CAAA;IACrB,SAAS,EAAE,uBAAuB,CAAA;IAClC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;CAC3B,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAAI,UAAU,gBAAgB,EAAE,aAAa,MAAM,KAAG,uBAAuB,EAkB7G,CAAA"}
|
|
@@ -8,7 +8,10 @@ export const getChannelOperations = (document, channelName) => {
|
|
|
8
8
|
const operations = document.operations ?? {};
|
|
9
9
|
return Object.entries(operations)
|
|
10
10
|
.map(([operationName, operationRef]) => {
|
|
11
|
-
const
|
|
11
|
+
const resolvedOperation = getResolvedRef(operationRef);
|
|
12
|
+
if (!resolvedOperation)
|
|
13
|
+
return undefined;
|
|
14
|
+
const operation = resolveOperationWithTraits(resolvedOperation);
|
|
12
15
|
const resolved = resolveOperationChannel(document, operation);
|
|
13
16
|
if (resolved?.channelName !== channelName) {
|
|
14
17
|
return undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-channel-parameters.d.ts","sourceRoot":"","sources":["../../src/channel-example/get-channel-parameters.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,qBAAqB,EACrB,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,4BAA4B,CAAA;AAKnC,MAAM,MAAM,wBAAwB,GAAG;IACrC,4DAA4D;IAC5D,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAA;IACpD,iEAAiE;IACjE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC5B,oEAAoE;IACpE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC9B,CAAA;AA+BD;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAC/B,SAAS,qBAAqB,EAC9B,YAAY,uBAAuB,GAAG,IAAI,EAC1C,YAAW,OAAO,CAAC,IAAI,CAAC,wBAAwB,EAAE,MAAM,GAAG,OAAO,CAAC,CAAM,KACxE,
|
|
1
|
+
{"version":3,"file":"get-channel-parameters.d.ts","sourceRoot":"","sources":["../../src/channel-example/get-channel-parameters.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,qBAAqB,EACrB,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,4BAA4B,CAAA;AAKnC,MAAM,MAAM,wBAAwB,GAAG;IACrC,4DAA4D;IAC5D,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAA;IACpD,iEAAiE;IACjE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC5B,oEAAoE;IACpE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC9B,CAAA;AA+BD;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAC/B,SAAS,qBAAqB,EAC9B,YAAY,uBAAuB,GAAG,IAAI,EAC1C,YAAW,OAAO,CAAC,IAAI,CAAC,wBAAwB,EAAE,MAAM,GAAG,OAAO,CAAC,CAAM,KACxE,wBAiCF,CAAA"}
|
|
@@ -33,7 +33,9 @@ export const getChannelParameters = (channel, operation, overrides = {}) => {
|
|
|
33
33
|
const definitions = {};
|
|
34
34
|
if (channel.parameters) {
|
|
35
35
|
for (const [name, parameterRef] of objectEntries(channel.parameters)) {
|
|
36
|
-
|
|
36
|
+
const parameter = getResolvedRef(parameterRef);
|
|
37
|
+
if (parameter)
|
|
38
|
+
definitions[name] = parameter;
|
|
37
39
|
}
|
|
38
40
|
}
|
|
39
41
|
const path = { ...overrides.path };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-channel.d.ts","sourceRoot":"","sources":["../../src/channel-example/resolve-channel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAIzF,MAAM,MAAM,eAAe,GAAG;IAC5B,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,qBAAqB,CAAA;IAC9B,cAAc,EAAE,MAAM,CAAA;CACvB,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,UAAU,gBAAgB,EAAE,aAAa,MAAM,KAAG,eAAe,GAAG,
|
|
1
|
+
{"version":3,"file":"resolve-channel.d.ts","sourceRoot":"","sources":["../../src/channel-example/resolve-channel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAIzF,MAAM,MAAM,eAAe,GAAG;IAC5B,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,qBAAqB,CAAA;IAC9B,cAAc,EAAE,MAAM,CAAA;CACvB,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,UAAU,gBAAgB,EAAE,aAAa,MAAM,KAAG,eAAe,GAAG,SAYlG,CAAA"}
|
|
@@ -8,6 +8,8 @@ export const resolveChannel = (document, channelName) => {
|
|
|
8
8
|
return undefined;
|
|
9
9
|
}
|
|
10
10
|
const channel = getResolvedRef(channelNode);
|
|
11
|
+
if (!channel)
|
|
12
|
+
return undefined;
|
|
11
13
|
const channelAddress = typeof channel.address === 'string' && channel.address.length > 0 ? channel.address : channelName;
|
|
12
14
|
return { channelName, channel, channelAddress };
|
|
13
15
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-operation-channel.d.ts","sourceRoot":"","sources":["../../src/channel-example/resolve-operation-channel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAA;AAKlH,MAAM,MAAM,wBAAwB,GAAG;IACrC,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,qBAAqB,CAAA;IAC9B,cAAc,EAAE,MAAM,CAAA;CACvB,CAAA;AAmBD;;GAEG;AACH,eAAO,MAAM,uBAAuB,GAClC,UAAU,gBAAgB,EAC1B,WAAW,uBAAuB,KACjC,wBAAwB,GAAG,
|
|
1
|
+
{"version":3,"file":"resolve-operation-channel.d.ts","sourceRoot":"","sources":["../../src/channel-example/resolve-operation-channel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAA;AAKlH,MAAM,MAAM,wBAAwB,GAAG;IACrC,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,qBAAqB,CAAA;IAC9B,cAAc,EAAE,MAAM,CAAA;CACvB,CAAA;AAmBD;;GAEG;AACH,eAAO,MAAM,uBAAuB,GAClC,UAAU,gBAAgB,EAC1B,WAAW,uBAAuB,KACjC,wBAAwB,GAAG,SAgC7B,CAAA"}
|
|
@@ -24,10 +24,14 @@ export const resolveOperationChannel = (document, operation) => {
|
|
|
24
24
|
const channelNameFromRef = '$ref' in channelNode ? getChannelNameFromRef(channelNode.$ref) : undefined;
|
|
25
25
|
if (channelNameFromRef && document.channels?.[channelNameFromRef]) {
|
|
26
26
|
const channel = getResolvedRef(document.channels[channelNameFromRef]);
|
|
27
|
+
if (!channel)
|
|
28
|
+
return undefined;
|
|
27
29
|
const channelAddress = typeof channel.address === 'string' && channel.address.length > 0 ? channel.address : channelNameFromRef;
|
|
28
30
|
return { channelName: channelNameFromRef, channel, channelAddress };
|
|
29
31
|
}
|
|
30
32
|
const channel = getResolvedRef(channelNode);
|
|
33
|
+
if (!channel)
|
|
34
|
+
return undefined;
|
|
31
35
|
const channelName = channelNameFromRef ??
|
|
32
36
|
findChannelName(document, channel) ??
|
|
33
37
|
(typeof channel.address === 'string' && channel.address.length > 0 ? channel.address : undefined);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getResolvedRef } from '../helpers/get-resolved-ref.js';
|
|
2
2
|
const getTraitSecurity = (traits) => traits.reduce((security, traitRef) => {
|
|
3
3
|
const trait = getResolvedRef(traitRef);
|
|
4
|
-
return trait
|
|
4
|
+
return trait?.security !== undefined ? trait.security : security;
|
|
5
5
|
}, undefined);
|
|
6
6
|
/**
|
|
7
7
|
* Merges operation traits into a single operation view, while keeping operation fields highest priority.
|
|
@@ -14,7 +14,7 @@ export const resolveOperationWithTraits = (operation) => {
|
|
|
14
14
|
const traitSecurity = getTraitSecurity(traits);
|
|
15
15
|
const traitBindings = traits.reduce((accumulated, traitRef) => {
|
|
16
16
|
const trait = getResolvedRef(traitRef);
|
|
17
|
-
if (!trait
|
|
17
|
+
if (!trait?.bindings) {
|
|
18
18
|
return accumulated;
|
|
19
19
|
}
|
|
20
20
|
const resolvedTraitBindings = getResolvedRef(trait.bindings);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"servers.d.ts","sourceRoot":"","sources":["../../src/channel-example/servers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,qBAAqB,EACrB,gBAAgB,EAChB,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,4BAA4B,CAAA;AAEnC,OAAO,EACL,KAAK,uBAAuB,EAI7B,MAAM,wCAAwC,CAAA;AAI/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAE5D,MAAM,MAAM,yBAAyB,GAAG;IACtC,OAAO,CAAC,EAAE,qBAAqB,GAAG,IAAI,CAAA;IACtC,SAAS,CAAC,EAAE,uBAAuB,GAAG,IAAI,CAAA;IAC1C,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACvC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACxC,oBAAoB,CAAC,EAAE,uBAAuB,CAAC,sBAAsB,CAAC,CAAA;IACtE,kFAAkF;IAClF,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,oBAAoB,CAAA;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,uEAAuE;IACvE,GAAG,EAAE,MAAM,CAAA;IACX,qEAAqE;IACrE,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,oEAAoE;IACpE,WAAW,EAAE,OAAO,CAAA;CACrB,CAAA;AAOD;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,GAChC,UAAU,gBAAgB,EAC1B,SAAS,qBAAqB,GAAG,IAAI,KACpC,GAAG,CAAC,MAAM,CAAC,GAAG,SAahB,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAC7B,UAAU,gBAAgB,EAC1B,UAAS,yBAA8B,KACtC,mBAAmB,
|
|
1
|
+
{"version":3,"file":"servers.d.ts","sourceRoot":"","sources":["../../src/channel-example/servers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,qBAAqB,EACrB,gBAAgB,EAChB,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,4BAA4B,CAAA;AAEnC,OAAO,EACL,KAAK,uBAAuB,EAI7B,MAAM,wCAAwC,CAAA;AAI/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAE5D,MAAM,MAAM,yBAAyB,GAAG;IACtC,OAAO,CAAC,EAAE,qBAAqB,GAAG,IAAI,CAAA;IACtC,SAAS,CAAC,EAAE,uBAAuB,GAAG,IAAI,CAAA;IAC1C,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACvC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACxC,oBAAoB,CAAC,EAAE,uBAAuB,CAAC,sBAAsB,CAAC,CAAA;IACtE,kFAAkF;IAClF,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,oBAAoB,CAAA;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,uEAAuE;IACvE,GAAG,EAAE,MAAM,CAAA;IACX,qEAAqE;IACrE,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,oEAAoE;IACpE,WAAW,EAAE,OAAO,CAAA;CACrB,CAAA;AAOD;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,GAChC,UAAU,gBAAgB,EAC1B,SAAS,qBAAqB,GAAG,IAAI,KACpC,GAAG,CAAC,MAAM,CAAC,GAAG,SAahB,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAC7B,UAAU,gBAAgB,EAC1B,UAAS,yBAA8B,KACtC,mBAAmB,EA+CrB,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,yBAAyB,GACpC,UAAU,iBAAiB,GAAG,IAAI,EAClC,SAAS,mBAAmB,EAAE,EAC9B,aAAa,uBAAuB,GAAG,IAAI,KAC1C,mBAAmB,GAAG,IAYxB,CAAA"}
|
|
@@ -35,6 +35,8 @@ export const getAsyncApiServers = (document, options = {}) => {
|
|
|
35
35
|
.filter(([name]) => channelServerNames?.has(name) ?? true)
|
|
36
36
|
.map(([name, serverRef]) => {
|
|
37
37
|
const server = resolveServer(serverRef);
|
|
38
|
+
if (!server)
|
|
39
|
+
return undefined;
|
|
38
40
|
const protocol = server.protocol.trim().toLowerCase();
|
|
39
41
|
const isWebSocket = isWebSocketProtocol(protocol);
|
|
40
42
|
const url = buildAsyncApiServerBaseUrl(server, environmentVariables);
|
|
@@ -60,7 +62,7 @@ export const getAsyncApiServers = (document, options = {}) => {
|
|
|
60
62
|
}
|
|
61
63
|
return entry;
|
|
62
64
|
})
|
|
63
|
-
.filter((entry) => (webSocketOnly
|
|
65
|
+
.filter((entry) => entry !== undefined && (!webSocketOnly || entry.isWebSocket));
|
|
64
66
|
};
|
|
65
67
|
/**
|
|
66
68
|
* Returns the selected AsyncAPI server entry, using `x-scalar-selected-asyncapi-server` on the document.
|
|
@@ -4,7 +4,7 @@ import type { AuthMeta } from '../events/index.js';
|
|
|
4
4
|
import type { SecuritySchemeObjectSecret } from '../request-example/builder/security/secret-types.js';
|
|
5
5
|
import type { MergedSecuritySchemes } from '../request-example/context/security/merge-security.js';
|
|
6
6
|
import type { XScalarEnvironment } from '../schemas/extensions/document/x-scalar-environments.js';
|
|
7
|
-
import type { SecurityRequirementObject } from '../schemas/v3.
|
|
7
|
+
import type { SecurityRequirementObject } from '../schemas/v3.2/strict/security-requirement.js';
|
|
8
8
|
import type { ChannelMessageEntry } from './get-all-channel-messages.js';
|
|
9
9
|
import type { ChannelOperationSummary } from './get-channel-operations.js';
|
|
10
10
|
import type { ChannelParametersContext } from './get-channel-parameters.js';
|
package/dist/client.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { type AuthStore } from './entities/auth/index.js';
|
|
|
5
5
|
import { type HistoryStore } from './entities/history/index.js';
|
|
6
6
|
import type { NavigationOptions } from './navigation/get-navigation-options.js';
|
|
7
7
|
import type { InMemoryWorkspace } from './schemas/inmemory-workspace.js';
|
|
8
|
-
import { type OpenApiDocument } from './schemas/v3.
|
|
8
|
+
import { type OpenApiDocument } from './schemas/v3.2/strict/openapi-document.js';
|
|
9
9
|
import type { DocumentMetaExtensions, Workspace, WorkspaceDocument, WorkspaceDocumentMeta, WorkspaceExtensions, WorkspaceMeta } from './schemas/workspace.js';
|
|
10
10
|
import type { WorkspaceSpecification } from './schemas/workspace-specification/index.js';
|
|
11
11
|
import type { WorkspacePlugin } from './workspace-plugin.js';
|
package/dist/client.js
CHANGED
|
@@ -27,9 +27,9 @@ import { createNavigation, traverseAsyncApiDocument } from './navigation/index.j
|
|
|
27
27
|
import { externalValueResolver, loadingStatus, normalizeAuthSchemes, normalizeRefs, refsEverywhere, removeExtraScalarKeys, restoreOriginalRefs, syncPathParameters, } from './plugins/bundler/index.js';
|
|
28
28
|
import { extensions } from './schemas/extensions.js';
|
|
29
29
|
import { isAsyncApiDocument, isOpenApiDocument } from './schemas/type-guards.js';
|
|
30
|
-
import { generateSchema } from './schemas/v3.
|
|
31
|
-
import { recursiveRef } from './schemas/v3.
|
|
32
|
-
import { OpenAPIDocumentSchema as OpenAPIDocumentSchemaStrict, } from './schemas/v3.
|
|
30
|
+
import { generateSchema } from './schemas/v3.2/openapi/index.js';
|
|
31
|
+
import { recursiveRef } from './schemas/v3.2/openapi/reference.js';
|
|
32
|
+
import { OpenAPIDocumentSchema as OpenAPIDocumentSchemaStrict, } from './schemas/v3.2/strict/openapi-document.js';
|
|
33
33
|
/**
|
|
34
34
|
* Maximum number of external references and example `externalValue`s fetched at once while bundling
|
|
35
35
|
* a document. Keeps large documents (which can reference thousands of external examples) from opening
|