@scalar/workspace-store 0.68.1 → 0.68.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 +34 -0
- package/dist/channel-example/get-async-api-protocols.d.ts +3 -1
- package/dist/channel-example/get-async-api-protocols.d.ts.map +1 -1
- package/dist/channel-example/get-async-api-protocols.js +6 -2
- package/dist/channel-example/get-asyncapi-security-requirements.d.ts +14 -2
- package/dist/channel-example/get-asyncapi-security-requirements.d.ts.map +1 -1
- package/dist/channel-example/get-asyncapi-security-requirements.js +89 -32
- package/dist/channel-example/get-channel-connection-context.d.ts.map +1 -1
- package/dist/channel-example/get-channel-connection-context.js +3 -4
- package/dist/channel-example/get-channel-connection-security.d.ts +3 -2
- package/dist/channel-example/get-channel-connection-security.d.ts.map +1 -1
- package/dist/channel-example/get-channel-connection-security.js +4 -6
- package/dist/channel-example/get-channel-operations.d.ts.map +1 -1
- package/dist/channel-example/get-channel-operations.js +2 -1
- package/dist/channel-example/get-channel-parameters.d.ts.map +1 -1
- package/dist/channel-example/get-channel-parameters.js +2 -1
- package/dist/channel-example/index.d.ts +2 -2
- package/dist/channel-example/index.d.ts.map +1 -1
- package/dist/channel-example/index.js +2 -2
- package/dist/channel-example/resolve-channel.d.ts.map +1 -1
- package/dist/channel-example/resolve-channel.js +2 -1
- package/dist/channel-example/resolve-operation-channel.d.ts.map +1 -1
- package/dist/channel-example/resolve-operation-channel.js +4 -2
- package/dist/channel-example/resolve-operation-with-traits.d.ts +1 -3
- package/dist/channel-example/resolve-operation-with-traits.d.ts.map +1 -1
- package/dist/channel-example/resolve-operation-with-traits.js +3 -41
- package/dist/channel-example/servers.d.ts.map +1 -1
- package/dist/channel-example/servers.js +2 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +15 -4
- package/dist/entities/auth/schema.d.ts +5 -0
- package/dist/entities/auth/schema.d.ts.map +1 -1
- package/dist/events/definitions/operation.d.ts +7 -0
- package/dist/events/definitions/operation.d.ts.map +1 -1
- package/dist/helpers/asyncapi-chunk-groups.d.ts.map +1 -1
- package/dist/helpers/asyncapi-chunk-groups.js +8 -4
- package/dist/helpers/asyncapi-model-chunk-reference.d.ts.map +1 -1
- package/dist/helpers/asyncapi-model-chunk-reference.js +2 -1
- package/dist/helpers/auth-secret-fields.d.ts +11 -0
- package/dist/helpers/auth-secret-fields.d.ts.map +1 -1
- package/dist/helpers/auth-secret-fields.js +22 -0
- package/dist/helpers/chunk-index.d.ts +2 -0
- package/dist/helpers/chunk-index.d.ts.map +1 -1
- package/dist/helpers/chunk-index.js +8 -1
- package/dist/helpers/encode-path-parameter.d.ts +20 -0
- package/dist/helpers/encode-path-parameter.d.ts.map +1 -0
- package/dist/helpers/encode-path-parameter.js +50 -0
- package/dist/helpers/external-examples.d.ts.map +1 -1
- package/dist/helpers/external-examples.js +6 -3
- package/dist/helpers/get-boolean-schema.d.ts +7 -0
- package/dist/helpers/get-boolean-schema.d.ts.map +1 -0
- package/dist/helpers/get-boolean-schema.js +5 -0
- package/dist/helpers/get-resolved-ref-deep.d.ts.map +1 -1
- package/dist/helpers/get-tag-kind.d.ts +6 -0
- package/dist/helpers/get-tag-kind.d.ts.map +1 -0
- package/dist/helpers/get-tag-kind.js +7 -0
- package/dist/helpers/normalize-boolean-schemas.d.ts.map +1 -1
- package/dist/helpers/normalize-boolean-schemas.js +6 -1
- package/dist/helpers/operation-examples.d.ts.map +1 -1
- package/dist/helpers/operation-examples.js +2 -1
- package/dist/helpers/querystring-parameter.d.ts.map +1 -1
- package/dist/helpers/querystring-parameter.js +6 -6
- package/dist/helpers/resolve-form-schema.d.ts +9 -0
- package/dist/helpers/resolve-form-schema.d.ts.map +1 -0
- package/dist/helpers/resolve-form-schema.js +143 -0
- package/dist/helpers/resolve-schema-with-annotations.d.ts +11 -0
- package/dist/helpers/resolve-schema-with-annotations.d.ts.map +1 -0
- package/dist/helpers/resolve-schema-with-annotations.js +57 -0
- package/dist/helpers/resolve-security-requirements.d.ts +15 -0
- package/dist/helpers/resolve-security-requirements.d.ts.map +1 -0
- package/dist/helpers/resolve-security-requirements.js +241 -0
- package/dist/helpers/resolve-traits.d.ts +3 -0
- package/dist/helpers/resolve-traits.d.ts.map +1 -0
- package/dist/helpers/resolve-traits.js +68 -0
- package/dist/helpers/serialize-stream-example.js +1 -1
- package/dist/helpers/use-external-examples.d.ts.map +1 -1
- package/dist/helpers/use-external-examples.js +10 -5
- package/dist/mutators/auth.d.ts.map +1 -1
- package/dist/mutators/auth.js +2 -1
- package/dist/mutators/operation/helpers/har-to-operation.d.ts.map +1 -1
- package/dist/mutators/operation/helpers/har-to-operation.js +4 -2
- package/dist/mutators/operation/operation.d.ts.map +1 -1
- package/dist/mutators/operation/operation.js +4 -2
- package/dist/mutators/operation/parameters.d.ts.map +1 -1
- package/dist/mutators/operation/parameters.js +23 -1
- package/dist/mutators/tag.d.ts.map +1 -1
- package/dist/mutators/tag.js +4 -2
- package/dist/navigation/get-navigation-options.js +6 -5
- package/dist/navigation/helpers/get-navigation-tag-names.d.ts +5 -0
- package/dist/navigation/helpers/get-navigation-tag-names.d.ts.map +1 -0
- package/dist/navigation/helpers/get-navigation-tag-names.js +3 -0
- package/dist/navigation/helpers/traverse-asyncapi-document.d.ts.map +1 -1
- package/dist/navigation/helpers/traverse-asyncapi-document.js +27 -20
- package/dist/navigation/helpers/traverse-paths.d.ts.map +1 -1
- package/dist/navigation/helpers/traverse-paths.js +5 -3
- package/dist/navigation/helpers/traverse-schemas.d.ts.map +1 -1
- package/dist/navigation/helpers/traverse-schemas.js +6 -3
- package/dist/navigation/helpers/traverse-tags.d.ts.map +1 -1
- package/dist/navigation/helpers/traverse-tags.js +8 -4
- package/dist/navigation/helpers/traverse-webhooks.d.ts.map +1 -1
- package/dist/navigation/helpers/traverse-webhooks.js +4 -2
- package/dist/plugins/bundler/index.d.ts.map +1 -1
- package/dist/plugins/bundler/index.js +2 -1
- package/dist/plugins/bundler/openapi-document.d.ts.map +1 -1
- package/dist/plugins/bundler/openapi-document.js +2 -1
- package/dist/request-example/builder/body/build-multipart.d.ts.map +1 -1
- package/dist/request-example/builder/body/build-multipart.js +18 -16
- package/dist/request-example/builder/body/build-request-body.d.ts.map +1 -1
- package/dist/request-example/builder/body/build-request-body.js +3 -5
- package/dist/request-example/builder/body/encode-multipart-body.d.ts.map +1 -1
- package/dist/request-example/builder/body/encode-multipart-body.js +2 -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 +2 -1
- package/dist/request-example/builder/body/schema-value-coercion.d.ts.map +1 -1
- package/dist/request-example/builder/body/schema-value-coercion.js +9 -8
- package/dist/request-example/builder/build-request.d.ts.map +1 -1
- package/dist/request-example/builder/build-request.js +3 -0
- package/dist/request-example/builder/header/build-request-parameters.d.ts +7 -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 +34 -3
- package/dist/request-example/builder/header/filter-disabled-properties.d.ts +3 -0
- package/dist/request-example/builder/header/filter-disabled-properties.d.ts.map +1 -0
- package/dist/request-example/builder/header/filter-disabled-properties.js +18 -0
- package/dist/request-example/builder/header/filter-global-cookies.d.ts +1 -1
- package/dist/request-example/builder/header/filter-global-cookies.d.ts.map +1 -1
- package/dist/request-example/builder/header/filter-global-cookies.js +15 -3
- package/dist/request-example/builder/header/is-param-disabled.d.ts +1 -1
- package/dist/request-example/builder/header/is-param-disabled.d.ts.map +1 -1
- package/dist/request-example/builder/header/is-param-disabled.js +3 -2
- 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 +20 -16
- package/dist/request-example/builder/helpers/get-example.d.ts +2 -0
- package/dist/request-example/builder/helpers/get-example.d.ts.map +1 -1
- package/dist/request-example/builder/helpers/get-example.js +15 -5
- 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 +6 -1
- package/dist/request-example/builder/request-factory.d.ts.map +1 -1
- package/dist/request-example/builder/request-factory.js +3 -1
- package/dist/request-example/builder/resolve-request-factory-url.d.ts.map +1 -1
- package/dist/request-example/builder/resolve-request-factory-url.js +23 -7
- package/dist/request-example/builder/security/secret-types.d.ts +13 -3
- package/dist/request-example/builder/security/secret-types.d.ts.map +1 -1
- package/dist/request-example/context/headers.js +1 -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 +63 -25
- package/dist/request-example/context/security/get-selected-security.js +1 -1
- package/dist/request-example/context/security/merge-security.d.ts.map +1 -1
- package/dist/request-example/context/security/merge-security.js +2 -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/request-example/xml/get-xml-example.js +2 -1
- package/dist/request-example/xml/write-xml.d.ts.map +1 -1
- package/dist/request-example/xml/write-xml.js +6 -5
- package/dist/resolve.d.ts +1 -1
- package/dist/resolve.d.ts.map +1 -1
- package/dist/resolve.js +16 -1
- package/dist/schemas/extensions/example/x-disabled.d.ts +4 -0
- package/dist/schemas/extensions/example/x-disabled.d.ts.map +1 -1
- package/dist/schemas/extensions/example/x-disabled.js +3 -1
- package/dist/schemas/navigation.d.ts +1 -1
- package/dist/schemas/navigation.d.ts.map +1 -1
- package/dist/schemas/reference-config/index.d.ts +1 -0
- package/dist/schemas/reference-config/index.d.ts.map +1 -1
- package/dist/schemas/reference-config/settings.d.ts +1 -0
- package/dist/schemas/reference-config/settings.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/example.d.ts +3 -0
- package/dist/schemas/v3.1/strict/example.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/openapi-document.d.ts +36 -6
- package/dist/schemas/v3.1/strict/openapi-document.d.ts.map +1 -1
- package/dist/schemas/v3.2/strict/example.d.ts +3 -0
- package/dist/schemas/v3.2/strict/example.d.ts.map +1 -1
- package/dist/schemas/v3.2/strict/openapi-document.d.ts +36 -6
- package/dist/schemas/v3.2/strict/openapi-document.d.ts.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +37 -8
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
# @scalar/workspace-store
|
|
2
2
|
|
|
3
|
+
## 0.68.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#10554](https://github.com/scalar/scalar/pull/10554): Render AsyncAPI boolean schemas with explanations in message payloads, headers, and reusable models.
|
|
8
|
+
- [#10551](https://github.com/scalar/scalar/pull/10551): Show **Reset to default** on authentication fields only when the field has a default that differs from its current value (the document or configured value, or the current page URL for the OAuth2 redirect URL). A cleared OAuth2 access token keeps the action so you can get back to the Authorize form. The show password toggle only appears once a field has a value, and an emptied field goes back to masked.
|
|
9
|
+
- [#10527](https://github.com/scalar/scalar/pull/10527): Document every visible AsyncAPI channel message in a channel catalog while preserving operation-specific message subsets, links, and server/protocol filtering.
|
|
10
|
+
- [#10565](https://github.com/scalar/scalar/pull/10565): Inherit AsyncAPI operation metadata and replies from traits using recursive merge rules, and use inherited titles in navigation.
|
|
11
|
+
- [#10559](https://github.com/scalar/scalar/pull/10559): Clean up Biome warnings in package code and tests. Handle rejected debounced callbacks and await streaming writes.
|
|
12
|
+
- [#10544](https://github.com/scalar/scalar/pull/10544): Match cookie paths with the RFC 6265 path-match algorithm so a cookie restricted to `/api` is not sent with requests to `/apiv2`.
|
|
13
|
+
- [#10505](https://github.com/scalar/scalar/pull/10505): Apply formatting and lint compatibility changes for Biome 2.5.15.
|
|
14
|
+
- [#10555](https://github.com/scalar/scalar/pull/10555): Keep expanded query parameter checkboxes independent and preserve disabled field values while excluding them from requests.
|
|
15
|
+
- [#10529](https://github.com/scalar/scalar/pull/10529): Align import and export ordering with the Biome checks.
|
|
16
|
+
- [#10524](https://github.com/scalar/scalar/pull/10524): Keep optional enum parameters disabled until explicitly enabled when no default or example is declared. Prefer declared schema examples over enum suggestions.
|
|
17
|
+
- [#10562](https://github.com/scalar/scalar/pull/10562): Resolve escaped channel and message identifiers in AsyncAPI navigation.
|
|
18
|
+
- [#10520](https://github.com/scalar/scalar/pull/10520): Sort imports and exports to satisfy the Biome checks.
|
|
19
|
+
- [#10566](https://github.com/scalar/scalar/pull/10566): Render inline AsyncAPI security schemes and scopes, keeping server authentication separate from operation security.
|
|
20
|
+
- [#10528](https://github.com/scalar/scalar/pull/10528): Render AsyncAPI channels and their messages when no operations reference them, including server and protocol filtering.
|
|
21
|
+
- [#10561](https://github.com/scalar/scalar/pull/10561): Clarify AsyncAPI operation and message sections, align message card spacing, and keep schema controls inside lighter expanded cards.
|
|
22
|
+
|
|
23
|
+
Show channel messages only when they are not used by an operation, and keep the sidebar in sync.
|
|
24
|
+
|
|
25
|
+
- [#10526](https://github.com/scalar/scalar/pull/10526): Align import and export ordering with the repository CI checks.
|
|
26
|
+
|
|
27
|
+
## 0.68.2
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- [#10491](https://github.com/scalar/scalar/pull/10491): Use OpenAPI 3.2 tag categories to keep badges and audience labels out of navigation groups and display them on operations.
|
|
32
|
+
- [#10489](https://github.com/scalar/scalar/pull/10489): Report invalid non-exploded structured cookies in OpenAPI 3.2 documents and prevent invalid request and code sample generation. Recommend `style: cookie` with `explode: true`.
|
|
33
|
+
- [#10480](https://github.com/scalar/scalar/pull/10480): Resolve structural allOf object fields and annotation-only wrappers and selected oneOf/anyOf variants in form body fields, preserving descriptions, nested inputs, and multipart value types when switching variants.
|
|
34
|
+
- [#10487](https://github.com/scalar/scalar/pull/10487): Honor OpenAPI 3.2 allowReserved for path parameters while escaping forbidden path characters and preserving the encoded path in Ruby code examples.
|
|
35
|
+
- [#10488](https://github.com/scalar/scalar/pull/10488): Resolve OpenAPI 3.2 security requirements by URI, including relative references based on the document URI, while preserving named schemes and authored exports.
|
|
36
|
+
|
|
3
37
|
## 0.68.1
|
|
4
38
|
|
|
5
39
|
### Patch Changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AsyncApiDocument, AsyncApiOperationObject } from '@scalar/types/asyncapi/3.1';
|
|
1
|
+
import type { AsyncApiChannelObject, AsyncApiDocument, AsyncApiOperationObject } from '@scalar/types/asyncapi/3.1';
|
|
2
2
|
/** Sentinel used by the protocol and server pickers to mean "don't filter". */
|
|
3
3
|
export declare const ALL: "all";
|
|
4
4
|
/** A single protocol option for the picker (e.g. `{ id: 'mqtt', label: 'MQTT' }`). */
|
|
@@ -61,6 +61,8 @@ export type OperationReachability = {
|
|
|
61
61
|
* one is created when called standalone.
|
|
62
62
|
*/
|
|
63
63
|
export declare const getOperationReachability: (document: AsyncApiDocument, operation: AsyncApiOperationObject, context?: AsyncApiReachabilityContext) => OperationReachability;
|
|
64
|
+
/** Returns the servers and protocols available to a channel without requiring an operation. */
|
|
65
|
+
export declare const getChannelReachability: (document: AsyncApiDocument, channel: AsyncApiChannelObject | null, context?: AsyncApiReachabilityContext) => OperationReachability;
|
|
64
66
|
/**
|
|
65
67
|
* Returns the set of protocols an operation is reachable over.
|
|
66
68
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-async-api-protocols.d.ts","sourceRoot":"","sources":["../../src/channel-example/get-async-api-protocols.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAA;
|
|
1
|
+
{"version":3,"file":"get-async-api-protocols.d.ts","sourceRoot":"","sources":["../../src/channel-example/get-async-api-protocols.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAA;AAQlH,+EAA+E;AAC/E,eAAO,MAAM,GAAG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ACH,eAAO,MAAM,qBAAqB,GAChC,UAAU,gBAAgB,EAC1B,WAAW,uBAAuB,EAClC,UAAU,2BAA2B,KACpC,GAAG,CAAC,MAAM,CAAqE,CAAA;AAElF;;GAEG;AACH,eAAO,MAAM,uBAAuB,GAClC,UAAU,gBAAgB,EAC1B,WAAW,uBAAuB,EAClC,UAAU,2BAA2B,KACpC,GAAG,CAAC,MAAM,CAAuE,CAAA;AAEpF;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,GACnC,UAAU,gBAAgB,EAC1B,WAAW,uBAAuB,EAClC,UAAU,MAAM,GAAG,SAAS,EAC5B,UAAU,2BAA2B,KACpC,OAMF,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,GACjC,UAAU,gBAAgB,EAC1B,WAAW,uBAAuB,EAClC,YAAY,MAAM,GAAG,SAAS,EAC9B,UAAU,2BAA2B,KACpC,OAMF,CAAA"}
|
|
@@ -63,8 +63,12 @@ export const createReachabilityContext = (document) => ({
|
|
|
63
63
|
*/
|
|
64
64
|
export const getOperationReachability = (document, operation, context = createReachabilityContext(document)) => {
|
|
65
65
|
const channel = resolveOperationChannel(document, operation)?.channel ?? null;
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
return getChannelReachability(document, channel, context);
|
|
67
|
+
};
|
|
68
|
+
/** Returns the servers and protocols available to a channel without requiring an operation. */
|
|
69
|
+
export const getChannelReachability = (document, channel, context = createReachabilityContext(document)) => {
|
|
70
|
+
// AsyncAPI makes channels with absent or empty server lists available on every server.
|
|
71
|
+
const channelServerNames = channel?.servers?.length ? getChannelServerNames(document, channel) : undefined;
|
|
68
72
|
const serverNames = channelServerNames
|
|
69
73
|
? new Set([...channelServerNames].filter((name) => context.allServerNames.has(name)))
|
|
70
74
|
: new Set(context.allServerNames);
|
|
@@ -1,9 +1,21 @@
|
|
|
1
|
-
import type { AsyncApiDocument, AsyncApiOperationObject, AsyncApiServerObject } from '@scalar/types/asyncapi/3.1';
|
|
1
|
+
import type { AsyncApiDocument, AsyncApiOperationObject, AsyncApiSecuritySchemeObject, AsyncApiServerObject } from '@scalar/types/asyncapi/3.1';
|
|
2
2
|
import type { SecurityRequirementObject } from '../schemas/v3.2/strict/security-requirement.js';
|
|
3
|
+
/**
|
|
4
|
+
* Collect inline definitions without changing the API description. Location-based names keep
|
|
5
|
+
* credentials for unrelated declarations separate, even when their definitions are identical.
|
|
6
|
+
* Component names remain unchanged for existing auth configuration and persisted credentials.
|
|
7
|
+
*/
|
|
8
|
+
export declare const getAsyncApiSecuritySchemes: (document: AsyncApiDocument, owners?: {
|
|
9
|
+
servers?: Record<string, AsyncApiServerObject>;
|
|
10
|
+
operations?: Record<string, AsyncApiOperationObject>;
|
|
11
|
+
}) => Record<string, AsyncApiSecuritySchemeObject>;
|
|
3
12
|
/**
|
|
4
13
|
* Converts AsyncAPI security arrays (operation, traits, server) into OpenAPI-style requirement objects.
|
|
5
14
|
*/
|
|
6
|
-
export declare const getAsyncApiSecurityRequirements: (document: AsyncApiDocument, operation?: AsyncApiOperationObject | null, server?: AsyncApiServerObject | null
|
|
15
|
+
export declare const getAsyncApiSecurityRequirements: (document: AsyncApiDocument, operation?: AsyncApiOperationObject | null, server?: AsyncApiServerObject | null, locations?: {
|
|
16
|
+
operationName?: string;
|
|
17
|
+
serverName?: string;
|
|
18
|
+
}) => SecurityRequirementObject[];
|
|
7
19
|
/**
|
|
8
20
|
* Document-wide security requirements for an AsyncAPI document.
|
|
9
21
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-asyncapi-security-requirements.d.ts","sourceRoot":"","sources":["../../src/channel-example/get-asyncapi-security-requirements.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,gBAAgB,EAChB,uBAAuB,
|
|
1
|
+
{"version":3,"file":"get-asyncapi-security-requirements.d.ts","sourceRoot":"","sources":["../../src/channel-example/get-asyncapi-security-requirements.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,gBAAgB,EAChB,uBAAuB,EACvB,4BAA4B,EAC5B,oBAAoB,EACrB,MAAM,4BAA4B,CAAA;AAInC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAA;AAyB3F;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,GACrC,UAAU,gBAAgB,EAC1B,SAAQ;IACN,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAA;IAC9C,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAA;CAChD,KACL,MAAM,CAAC,MAAM,EAAE,4BAA4B,CAqC7C,CAAA;AAwED;;GAEG;AACH,eAAO,MAAM,+BAA+B,GAC1C,UAAU,gBAAgB,EAC1B,YAAY,uBAAuB,GAAG,IAAI,EAC1C,SAAS,oBAAoB,GAAG,IAAI,EACpC,YAAW;IAAE,aAAa,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAO,KAC9D,yBAAyB,EAoC3B,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,uCAAuC,GAAI,UAAU,gBAAgB,KAAG,yBAAyB,EA6B7G,CAAA"}
|
|
@@ -2,6 +2,7 @@ import { isObjectEqual } from '@scalar/helpers/object/is-object-equal';
|
|
|
2
2
|
import { getNameFromRef } from '../helpers/get-name-from-ref.js';
|
|
3
3
|
import { getResolvedRef } from '../helpers/get-resolved-ref.js';
|
|
4
4
|
import { dedupeRequirements } from './dedupe-requirements.js';
|
|
5
|
+
import { resolveOperationWithTraits } from './resolve-operation-with-traits.js';
|
|
5
6
|
const getSecuritySchemeNameFromRef = (ref) => getNameFromRef(ref, ['components', 'securitySchemes']);
|
|
6
7
|
/** Strips requirement-only `scopes` so inline entries can match component scheme definitions. */
|
|
7
8
|
const getSecuritySchemeDefinition = (entry) => {
|
|
@@ -15,56 +16,109 @@ const getSecuritySchemeDefinition = (entry) => {
|
|
|
15
16
|
const { scopes: _scopes, ...scheme } = resolved;
|
|
16
17
|
return scheme;
|
|
17
18
|
};
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Collect inline definitions without changing the API description. Location-based names keep
|
|
21
|
+
* credentials for unrelated declarations separate, even when their definitions are identical.
|
|
22
|
+
* Component names remain unchanged for existing auth configuration and persisted credentials.
|
|
23
|
+
*/
|
|
24
|
+
export const getAsyncApiSecuritySchemes = (document, owners = {}) => {
|
|
25
|
+
const components = document.components ? getResolvedRef(document.components) : undefined;
|
|
26
|
+
const schemes = {};
|
|
27
|
+
for (const [name, reference] of Object.entries(components?.securitySchemes ?? {})) {
|
|
28
|
+
const scheme = getResolvedRef(reference);
|
|
29
|
+
if (scheme) {
|
|
30
|
+
schemes[name] = scheme;
|
|
23
31
|
}
|
|
24
32
|
}
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return name;
|
|
33
|
+
const register = (security, location) => {
|
|
34
|
+
for (const [index, entry] of (security ?? []).entries()) {
|
|
35
|
+
const scheme = getResolvedRef(entry);
|
|
36
|
+
if (!scheme || !('type' in scheme)) {
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
const componentName = getComponentSecuritySchemeName(document, entry);
|
|
40
|
+
if (componentName !== undefined) {
|
|
41
|
+
continue;
|
|
35
42
|
}
|
|
43
|
+
schemes[getInlineSecuritySchemeName(document, scheme, location, index)] = scheme;
|
|
36
44
|
}
|
|
45
|
+
};
|
|
46
|
+
const servers = owners.servers ?? (document.servers ? getResolvedRef(document.servers) : undefined);
|
|
47
|
+
for (const [name, reference] of Object.entries(servers ?? {})) {
|
|
48
|
+
register(getResolvedRef(reference)?.security, `Server ${name}`);
|
|
37
49
|
}
|
|
38
|
-
|
|
50
|
+
const operations = owners.operations ?? (document.operations ? getResolvedRef(document.operations) : undefined);
|
|
51
|
+
for (const [name, reference] of Object.entries(operations ?? {})) {
|
|
52
|
+
const operation = getResolvedRef(reference);
|
|
53
|
+
if (operation) {
|
|
54
|
+
register(resolveOperationWithTraits(operation).security, `Operation ${name}`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return schemes;
|
|
39
58
|
};
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
59
|
+
const getComponentSecuritySchemeName = (document, entry) => {
|
|
60
|
+
if ('$ref' in entry) {
|
|
61
|
+
const name = getSecuritySchemeNameFromRef(entry.$ref);
|
|
62
|
+
if (name !== undefined) {
|
|
63
|
+
return name;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
const definition = getSecuritySchemeDefinition(entry);
|
|
67
|
+
if (!definition) {
|
|
43
68
|
return undefined;
|
|
44
69
|
}
|
|
70
|
+
const components = document.components ? getResolvedRef(document.components) : undefined;
|
|
71
|
+
return Object.entries(components?.securitySchemes ?? {}).find(([, scheme]) => isObjectEqual(getSecuritySchemeDefinition(scheme), definition))?.[0];
|
|
72
|
+
};
|
|
73
|
+
/** Use declaration locations rather than object identity: traits can share the same object. */
|
|
74
|
+
const getInlineSecuritySchemeName = (document, scheme, location, index) => {
|
|
75
|
+
const components = document.components ? getResolvedRef(document.components) : undefined;
|
|
76
|
+
const availableName = (name) => Object.hasOwn(components?.securitySchemes ?? {}, name) ? availableName(`${name} (inline)`) : name;
|
|
77
|
+
return availableName(`${location} · ${scheme.type} ${index + 1}`);
|
|
78
|
+
};
|
|
79
|
+
const securityEntryToRequirement = (document, entry, index, location, schemes) => {
|
|
45
80
|
const resolved = getResolvedRef(entry);
|
|
81
|
+
const schemeName = getComponentSecuritySchemeName(document, entry) ??
|
|
82
|
+
(resolved && 'type' in resolved && location !== undefined
|
|
83
|
+
? getInlineSecuritySchemeName(document, resolved, location, index)
|
|
84
|
+
: Object.entries(schemes).find(([, scheme]) => scheme === resolved)?.[0]);
|
|
85
|
+
if (schemeName === undefined) {
|
|
86
|
+
return undefined;
|
|
87
|
+
}
|
|
46
88
|
const scopes = resolved != null && 'scopes' in resolved && Array.isArray(resolved.scopes) ? [...resolved.scopes] : [];
|
|
47
89
|
return { [schemeName]: scopes };
|
|
48
90
|
};
|
|
49
|
-
const collectSecurityRequirements = (document, security) => {
|
|
91
|
+
const collectSecurityRequirements = (document, security, location, schemes) => {
|
|
50
92
|
if (!security?.length) {
|
|
51
93
|
return [];
|
|
52
94
|
}
|
|
53
95
|
return security
|
|
54
|
-
.map((entry) => securityEntryToRequirement(document, entry))
|
|
96
|
+
.map((entry, index) => securityEntryToRequirement(document, entry, index, location, schemes))
|
|
55
97
|
.filter((requirement) => requirement != null);
|
|
56
98
|
};
|
|
57
99
|
/**
|
|
58
100
|
* Converts AsyncAPI security arrays (operation, traits, server) into OpenAPI-style requirement objects.
|
|
59
101
|
*/
|
|
60
|
-
export const getAsyncApiSecurityRequirements = (document, operation, server) => {
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
102
|
+
export const getAsyncApiSecurityRequirements = (document, operation, server, locations = {}) => {
|
|
103
|
+
// Existing callers can omit locations. Build their fallback registry once, not once per entry.
|
|
104
|
+
const needsRegistry = (operation?.security?.length && locations.operationName === undefined) ||
|
|
105
|
+
(server?.security?.length && locations.serverName === undefined);
|
|
106
|
+
const schemes = needsRegistry ? getAsyncApiSecuritySchemes(document) : {};
|
|
107
|
+
const operationRequirements = collectSecurityRequirements(document, operation?.security, locations.operationName === undefined ? undefined : `Operation ${locations.operationName}`, schemes);
|
|
108
|
+
const serverRequirements = collectSecurityRequirements(document, server?.security, locations.serverName === undefined ? undefined : `Server ${locations.serverName}`, schemes);
|
|
109
|
+
if (operationRequirements.length === 0) {
|
|
110
|
+
return dedupeRequirements(serverRequirements);
|
|
111
|
+
}
|
|
112
|
+
if (serverRequirements.length === 0) {
|
|
113
|
+
return dedupeRequirements(operationRequirements);
|
|
114
|
+
}
|
|
115
|
+
const combined = operationRequirements.flatMap((operationRequirement) => serverRequirements.map((serverRequirement) => {
|
|
116
|
+
const combined = { ...serverRequirement };
|
|
117
|
+
for (const [name, scopes] of Object.entries(operationRequirement)) {
|
|
118
|
+
combined[name] = [...new Set([...(combined[name] ?? []), ...(scopes ?? [])])];
|
|
119
|
+
}
|
|
120
|
+
return combined;
|
|
121
|
+
}));
|
|
68
122
|
return dedupeRequirements(combined);
|
|
69
123
|
};
|
|
70
124
|
/**
|
|
@@ -79,8 +133,11 @@ export const getAsyncApiDocumentSecurityRequirements = (document) => {
|
|
|
79
133
|
if (!servers) {
|
|
80
134
|
return [];
|
|
81
135
|
}
|
|
82
|
-
const resolvedServers = Object.
|
|
83
|
-
|
|
136
|
+
const resolvedServers = Object.entries(servers).map(([name, serverRef]) => ({
|
|
137
|
+
name,
|
|
138
|
+
server: getResolvedRef(serverRef),
|
|
139
|
+
}));
|
|
140
|
+
const perServerRequirements = resolvedServers.map(({ name, server }) => getAsyncApiSecurityRequirements(document, null, server, { serverName: name }));
|
|
84
141
|
const combined = perServerRequirements.flat();
|
|
85
142
|
// When some servers require auth while others accept unauthenticated connections, surface the
|
|
86
143
|
// no-auth path as an optional `{}` requirement so those servers stay selectable. "No auth" is
|
|
@@ -88,7 +145,7 @@ export const getAsyncApiDocumentSecurityRequirements = (document) => {
|
|
|
88
145
|
// security failed to resolve to a scheme — that server still requires auth. If no server
|
|
89
146
|
// requires auth at all, we return `[]` and let the selector treat every scheme as optional.
|
|
90
147
|
const someRequireAuth = perServerRequirements.some((requirements) => requirements.length > 0);
|
|
91
|
-
const someDeclareNoAuth = resolvedServers.some((server) => !server?.security?.length);
|
|
148
|
+
const someDeclareNoAuth = resolvedServers.some(({ server }) => !server?.security?.length);
|
|
92
149
|
if (someRequireAuth && someDeclareNoAuth) {
|
|
93
150
|
combined.push({});
|
|
94
151
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-channel-connection-context.d.ts","sourceRoot":"","sources":["../../src/channel-example/get-channel-connection-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAA;
|
|
1
|
+
{"version":3,"file":"get-channel-connection-context.d.ts","sourceRoot":"","sources":["../../src/channel-example/get-channel-connection-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAA;AAU9E,OAAO,KAAK,EAAE,6BAA6B,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AACnG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAO9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAErD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAK5D;;;GAGG;AACH,eAAO,MAAM,2BAA2B,GACtC,gBAAgB,cAAc,EAC9B,cAAc,MAAM,EACpB,uBAAuB,qBAAqB,EAC5C,UAAS,OAAO,CAAC;IACf,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACtC,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACvC,cAAc,EAAE,2BAA2B,CAAA;IAC3C,gBAAgB,EAAE,iBAAiB,GAAG,IAAI,CAAA;CAC3C,CAAM,KACN,MAAM,CAAC,6BAA6B,CAuItC,CAAA"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { buildConnectionUrl } from '../channel-example/build-connection-url.js';
|
|
2
2
|
import { getAllChannelMessages } from '../channel-example/get-all-channel-messages.js';
|
|
3
|
+
import { getAsyncApiSecuritySchemes } from '../channel-example/get-asyncapi-security-requirements.js';
|
|
3
4
|
import { getChannelConnectionSecurityRequirements } from '../channel-example/get-channel-connection-security.js';
|
|
4
5
|
import { getChannelOperations } from '../channel-example/get-channel-operations.js';
|
|
5
6
|
import { getChannelParameters } from '../channel-example/get-channel-parameters.js';
|
|
6
7
|
import { resolveChannel } from '../channel-example/resolve-channel.js';
|
|
7
8
|
import { getAsyncApiServers, getSelectedAsyncApiServer } from '../channel-example/servers.js';
|
|
8
|
-
import { getResolvedRef } from '../helpers/get-resolved-ref.js';
|
|
9
9
|
import { getEnvironmentVariables } from '../request-example/builder/helpers/get-environment-variables.js';
|
|
10
10
|
import { getActiveEnvironment } from '../request-example/context/environment.js';
|
|
11
11
|
import { getSecuritySchemes } from '../request-example/context/security/get-security-schemes.js';
|
|
@@ -84,9 +84,8 @@ export const getChannelConnectionContext = (workspaceStore, documentName, channe
|
|
|
84
84
|
path: channelName,
|
|
85
85
|
method: ASYNCAPI_CHANNEL_AUTH_METHOD,
|
|
86
86
|
});
|
|
87
|
-
const
|
|
88
|
-
const
|
|
89
|
-
const securityRequirements = getChannelConnectionSecurityRequirements(document, channel, selectedServer?.server ?? null, channelOperations);
|
|
87
|
+
const securitySchemes = mergeSecurity(getAsyncApiSecuritySchemes(document, { operations: {} }), options.authentication?.securitySchemes ?? {}, workspaceStore.auth, documentName);
|
|
88
|
+
const securityRequirements = getChannelConnectionSecurityRequirements(document, channel, selectedServer?.server ?? null, channelOperations, selectedServer?.name);
|
|
90
89
|
const selectedSecurity = getSelectedSecurity(documentSelectedSecurity, channelSelectedSecurity, securityRequirements, securitySchemes, options.authentication?.preferredSecurityScheme);
|
|
91
90
|
const selectedSecuritySchemes = getSecuritySchemes(securitySchemes, selectedSecurity.selectedSchemes[selectedSecurity.selectedIndex] ?? {});
|
|
92
91
|
const authMeta = channelSelectedSecurity
|
|
@@ -2,7 +2,8 @@ import type { AsyncApiChannelObject, AsyncApiDocument, AsyncApiServerObject } fr
|
|
|
2
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
|
+
* Connection authentication belongs to the selected server; operation security is documented separately.
|
|
6
|
+
* Keep the channel arguments for compatibility with existing consumers of this public helper.
|
|
6
7
|
*/
|
|
7
|
-
export declare const getChannelConnectionSecurityRequirements: (document: AsyncApiDocument, _channel: AsyncApiChannelObject, server: AsyncApiServerObject | null,
|
|
8
|
+
export declare const getChannelConnectionSecurityRequirements: (document: AsyncApiDocument, _channel: AsyncApiChannelObject, server: AsyncApiServerObject | null, _channelOperations: ChannelOperationSummary[], serverName?: string) => SecurityRequirementObject[];
|
|
8
9
|
//# sourceMappingURL=get-channel-connection-security.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-channel-connection-security.d.ts","sourceRoot":"","sources":["../../src/channel-example/get-channel-connection-security.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AAG/G,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAA;
|
|
1
|
+
{"version":3,"file":"get-channel-connection-security.d.ts","sourceRoot":"","sources":["../../src/channel-example/get-channel-connection-security.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AAG/G,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAA;AAE3F,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAA;AAEvE;;;GAGG;AACH,eAAO,MAAM,wCAAwC,GACnD,UAAU,gBAAgB,EAC1B,UAAU,qBAAqB,EAC/B,QAAQ,oBAAoB,GAAG,IAAI,EACnC,oBAAoB,uBAAuB,EAAE,EAC7C,aAAa,MAAM,KAClB,yBAAyB,EAE3B,CAAA"}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { getAsyncApiSecurityRequirements } from '../channel-example/get-asyncapi-security-requirements.js';
|
|
2
|
-
import { dedupeRequirements } from './dedupe-requirements.js';
|
|
3
2
|
/**
|
|
4
|
-
*
|
|
3
|
+
* Connection authentication belongs to the selected server; operation security is documented separately.
|
|
4
|
+
* Keep the channel arguments for compatibility with existing consumers of this public helper.
|
|
5
5
|
*/
|
|
6
|
-
export const getChannelConnectionSecurityRequirements = (document, _channel, server,
|
|
7
|
-
|
|
8
|
-
const operationRequirements = channelOperations.flatMap(({ operation }) => getAsyncApiSecurityRequirements(document, operation, null));
|
|
9
|
-
return dedupeRequirements([...serverRequirements, ...operationRequirements]);
|
|
6
|
+
export const getChannelConnectionSecurityRequirements = (document, _channel, server, _channelOperations, serverName) => {
|
|
7
|
+
return getAsyncApiSecurityRequirements(document, null, server, { serverName });
|
|
10
8
|
};
|
|
@@ -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,EAoB7G,CAAA"}
|
|
@@ -9,8 +9,9 @@ export const getChannelOperations = (document, channelName) => {
|
|
|
9
9
|
return Object.entries(operations)
|
|
10
10
|
.map(([operationName, operationRef]) => {
|
|
11
11
|
const resolvedOperation = getResolvedRef(operationRef);
|
|
12
|
-
if (!resolvedOperation)
|
|
12
|
+
if (!resolvedOperation) {
|
|
13
13
|
return undefined;
|
|
14
|
+
}
|
|
14
15
|
const operation = resolveOperationWithTraits(resolvedOperation);
|
|
15
16
|
const resolved = resolveOperationChannel(document, operation);
|
|
16
17
|
if (resolved?.channelName !== channelName) {
|
|
@@ -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,wBAmCF,CAAA"}
|
|
@@ -34,8 +34,9 @@ export const getChannelParameters = (channel, operation, overrides = {}) => {
|
|
|
34
34
|
if (channel.parameters) {
|
|
35
35
|
for (const [name, parameterRef] of objectEntries(channel.parameters)) {
|
|
36
36
|
const parameter = getResolvedRef(parameterRef);
|
|
37
|
-
if (parameter)
|
|
37
|
+
if (parameter) {
|
|
38
38
|
definitions[name] = parameter;
|
|
39
|
+
}
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
42
|
const path = { ...overrides.path };
|
|
@@ -3,8 +3,8 @@ export { ASYNCAPI_WEBSOCKET_PROTOCOLS, buildAsyncApiServerBaseUrl, buildConnecti
|
|
|
3
3
|
export type { ChannelMessageEntry } from './get-all-channel-messages.js';
|
|
4
4
|
export { getAllChannelMessages } from './get-all-channel-messages.js';
|
|
5
5
|
export type { AsyncApiProtocolOption, AsyncApiReachabilityContext, AsyncApiServerOption, OperationReachability, } from './get-async-api-protocols.js';
|
|
6
|
-
export { ALL, createReachabilityContext, getAsyncApiProtocols, getAsyncApiServerOptions, getOperationProtocols, getOperationReachability, getOperationServerNames, operationMatchesProtocol, operationMatchesServer, } from './get-async-api-protocols.js';
|
|
7
|
-
export { getAsyncApiDocumentSecurityRequirements, getAsyncApiSecurityRequirements, } from './get-asyncapi-security-requirements.js';
|
|
6
|
+
export { ALL, createReachabilityContext, getAsyncApiProtocols, getAsyncApiServerOptions, getChannelReachability, getOperationProtocols, getOperationReachability, getOperationServerNames, operationMatchesProtocol, operationMatchesServer, } from './get-async-api-protocols.js';
|
|
7
|
+
export { getAsyncApiDocumentSecurityRequirements, getAsyncApiSecurityRequirements, getAsyncApiSecuritySchemes, } from './get-asyncapi-security-requirements.js';
|
|
8
8
|
export { getChannelConnectionContext } from './get-channel-connection-context.js';
|
|
9
9
|
export { getChannelConnectionSecurityRequirements } from './get-channel-connection-security.js';
|
|
10
10
|
export type { ChannelOperationSummary } from './get-channel-operations.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/channel-example/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,yBAAyB,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAA;AAChG,OAAO,EACL,4BAA4B,EAC5B,0BAA0B,EAC1B,kBAAkB,EAClB,kBAAkB,EAClB,0BAA0B,EAC1B,wBAAwB,EACxB,mBAAmB,EACnB,eAAe,GAChB,MAAM,wBAAwB,CAAA;AAC/B,YAAY,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AAClE,YAAY,EACV,sBAAsB,EACtB,2BAA2B,EAC3B,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EACL,GAAG,EACH,yBAAyB,EACzB,oBAAoB,EACpB,wBAAwB,EACxB,qBAAqB,EACrB,wBAAwB,EACxB,uBAAuB,EACvB,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EACL,uCAAuC,EACvC,+BAA+B,
|
|
1
|
+
{"version":3,"file":"index.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AE,uBAAuB,EAAE,MAAM,6BAA6B,CAAA;AACrE,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAA;AAC5E,YAAY,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAA;AAC/E,OAAO,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAA;AACzE,YAAY,EAAE,6BAA6B,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { ASYNCAPI_WEBSOCKET_PROTOCOLS, buildAsyncApiServerBaseUrl, buildConnectionUrl, buildWsQueryParams, getAsyncApiServerVariables, getUrlSchemeFromProtocol, isWebSocketProtocol, mergeWsBindings, } from './build-connection-url.js';
|
|
2
2
|
export { getAllChannelMessages } from './get-all-channel-messages.js';
|
|
3
|
-
export { ALL, createReachabilityContext, getAsyncApiProtocols, getAsyncApiServerOptions, getOperationProtocols, getOperationReachability, getOperationServerNames, operationMatchesProtocol, operationMatchesServer, } from './get-async-api-protocols.js';
|
|
4
|
-
export { getAsyncApiDocumentSecurityRequirements, getAsyncApiSecurityRequirements, } from './get-asyncapi-security-requirements.js';
|
|
3
|
+
export { ALL, createReachabilityContext, getAsyncApiProtocols, getAsyncApiServerOptions, getChannelReachability, getOperationProtocols, getOperationReachability, getOperationServerNames, operationMatchesProtocol, operationMatchesServer, } from './get-async-api-protocols.js';
|
|
4
|
+
export { getAsyncApiDocumentSecurityRequirements, getAsyncApiSecurityRequirements, getAsyncApiSecuritySchemes, } from './get-asyncapi-security-requirements.js';
|
|
5
5
|
export { getChannelConnectionContext } from './get-channel-connection-context.js';
|
|
6
6
|
export { getChannelConnectionSecurityRequirements } from './get-channel-connection-security.js';
|
|
7
7
|
export { getChannelOperations } from './get-channel-operations.js';
|
|
@@ -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,SAclG,CAAA"}
|
|
@@ -8,8 +8,9 @@ export const resolveChannel = (document, channelName) => {
|
|
|
8
8
|
return undefined;
|
|
9
9
|
}
|
|
10
10
|
const channel = getResolvedRef(channelNode);
|
|
11
|
-
if (!channel)
|
|
11
|
+
if (!channel) {
|
|
12
12
|
return undefined;
|
|
13
|
+
}
|
|
13
14
|
const channelAddress = typeof channel.address === 'string' && channel.address.length > 0 ? channel.address : channelName;
|
|
14
15
|
return { channelName, channel, channelAddress };
|
|
15
16
|
};
|
|
@@ -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,SAoC7B,CAAA"}
|
|
@@ -24,14 +24,16 @@ 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)
|
|
27
|
+
if (!channel) {
|
|
28
28
|
return undefined;
|
|
29
|
+
}
|
|
29
30
|
const channelAddress = typeof channel.address === 'string' && channel.address.length > 0 ? channel.address : channelNameFromRef;
|
|
30
31
|
return { channelName: channelNameFromRef, channel, channelAddress };
|
|
31
32
|
}
|
|
32
33
|
const channel = getResolvedRef(channelNode);
|
|
33
|
-
if (!channel)
|
|
34
|
+
if (!channel) {
|
|
34
35
|
return undefined;
|
|
36
|
+
}
|
|
35
37
|
const channelName = channelNameFromRef ??
|
|
36
38
|
findChannelName(document, channel) ??
|
|
37
39
|
(typeof channel.address === 'string' && channel.address.length > 0 ? channel.address : undefined);
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import type { AsyncApiOperationObject } from '@scalar/types/asyncapi/3.1';
|
|
2
|
-
/**
|
|
3
|
-
* Merges operation traits into a single operation view, while keeping operation fields highest priority.
|
|
4
|
-
*/
|
|
2
|
+
/** Merge operation traits in order, while keeping operation fields highest priority. */
|
|
5
3
|
export declare const resolveOperationWithTraits: (operation: AsyncApiOperationObject) => AsyncApiOperationObject;
|
|
6
4
|
//# sourceMappingURL=resolve-operation-with-traits.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-operation-with-traits.d.ts","sourceRoot":"","sources":["../../src/channel-example/resolve-operation-with-traits.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAA;
|
|
1
|
+
{"version":3,"file":"resolve-operation-with-traits.d.ts","sourceRoot":"","sources":["../../src/channel-example/resolve-operation-with-traits.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAA;AAIzE,wFAAwF;AACxF,eAAO,MAAM,0BAA0B,GAAI,WAAW,uBAAuB,KAAG,uBAC9B,CAAA"}
|
|
@@ -1,41 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
return trait?.security !== undefined ? trait.security : security;
|
|
5
|
-
}, undefined);
|
|
6
|
-
/**
|
|
7
|
-
* Merges operation traits into a single operation view, while keeping operation fields highest priority.
|
|
8
|
-
*/
|
|
9
|
-
export const resolveOperationWithTraits = (operation) => {
|
|
10
|
-
const traits = operation.traits ?? [];
|
|
11
|
-
if (traits.length === 0) {
|
|
12
|
-
return operation;
|
|
13
|
-
}
|
|
14
|
-
const traitSecurity = getTraitSecurity(traits);
|
|
15
|
-
const traitBindings = traits.reduce((accumulated, traitRef) => {
|
|
16
|
-
const trait = getResolvedRef(traitRef);
|
|
17
|
-
if (!trait?.bindings) {
|
|
18
|
-
return accumulated;
|
|
19
|
-
}
|
|
20
|
-
const resolvedTraitBindings = getResolvedRef(trait.bindings);
|
|
21
|
-
return accumulated
|
|
22
|
-
? {
|
|
23
|
-
...getResolvedRef(accumulated),
|
|
24
|
-
...resolvedTraitBindings,
|
|
25
|
-
}
|
|
26
|
-
: resolvedTraitBindings;
|
|
27
|
-
}, undefined);
|
|
28
|
-
const hasOperationSecurity = operation.security !== undefined;
|
|
29
|
-
const security = operation.security ?? traitSecurity;
|
|
30
|
-
const bindings = traitBindings && operation.bindings
|
|
31
|
-
? {
|
|
32
|
-
...getResolvedRef(traitBindings),
|
|
33
|
-
...getResolvedRef(operation.bindings),
|
|
34
|
-
}
|
|
35
|
-
: (operation.bindings ?? traitBindings);
|
|
36
|
-
return {
|
|
37
|
-
...operation,
|
|
38
|
-
...(security !== undefined || hasOperationSecurity ? { security } : {}),
|
|
39
|
-
...(bindings !== operation.bindings ? { bindings } : {}),
|
|
40
|
-
};
|
|
41
|
-
};
|
|
1
|
+
import { resolveTraits } from '../helpers/resolve-traits.js';
|
|
2
|
+
/** Merge operation traits in order, while keeping operation fields highest priority. */
|
|
3
|
+
export const resolveOperationWithTraits = (operation) => resolveTraits(operation, operation.traits ?? []);
|
|
@@ -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,E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IAYxB,CAAA"}
|
|
@@ -35,8 +35,9 @@ 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)
|
|
38
|
+
if (!server) {
|
|
39
39
|
return undefined;
|
|
40
|
+
}
|
|
40
41
|
const protocol = server.protocol.trim().toLowerCase();
|
|
41
42
|
const isWebSocket = isWebSocketProtocol(protocol);
|
|
42
43
|
const url = buildAsyncApiServerBaseUrl(server, environmentVariables);
|
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;AAM1E,OAAO,EAAE,KAAK,uBAAuB,EAAiC,MAAM,6BAA6B,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,OAAO,EAAE,KAAK,SAAS,EAAmB,MAAM,iBAAiB,CAAA;AACjE,OAAO,EAAE,KAAK,YAAY,EAAsB,MAAM,oBAAoB,CAAA;AAM1E,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