@scalar/workspace-store 0.68.4 → 0.69.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 +22 -0
- package/dist/channel-example/get-channel-connection-context.d.ts +1 -1
- package/dist/channel-example/get-channel-connection-context.js +8 -8
- package/dist/channel-example/get-channel-connection-security.js +1 -1
- package/dist/channel-example/get-channel-parameters.js +1 -1
- package/dist/channel-example/servers.d.ts +1 -1
- package/dist/channel-example/servers.js +1 -1
- package/dist/entities/auth/index.d.ts +1 -1
- package/dist/entities/auth/index.js +1 -1
- package/dist/entities/history/index.d.ts +1 -1
- package/dist/entities/history/index.js +1 -1
- package/dist/events/definitions/cookie.d.ts +1 -1
- package/dist/events/definitions/environment.d.ts +1 -1
- package/dist/events/definitions/hooks.d.ts +1 -1
- package/dist/events/definitions/index.d.ts +5 -5
- package/dist/helpers/asyncapi-model-chunk-reference.js +1 -1
- package/dist/helpers/chunk-index.d.ts.map +1 -1
- package/dist/helpers/chunk-index.js +9 -1
- package/dist/helpers/document-revision.js +1 -1
- package/dist/helpers/dynamic-ref.js +2 -2
- package/dist/helpers/for-each-path-item-operation.d.ts +1 -1
- package/dist/helpers/for-each-path-item-operation.js +1 -1
- package/dist/helpers/get-example-value.js +1 -1
- package/dist/helpers/get-parameter-example.js +1 -1
- package/dist/helpers/operation-examples.js +1 -1
- package/dist/helpers/querystring-parameter.js +1 -1
- package/dist/helpers/resolve-async-api-schema.d.ts +16 -0
- package/dist/helpers/resolve-async-api-schema.d.ts.map +1 -0
- package/dist/helpers/resolve-async-api-schema.js +42 -0
- package/dist/helpers/resolve-security-requirements.js +2 -2
- package/dist/helpers/snapshot-schema.js +1 -1
- package/dist/helpers/unpack-proxy.js +2 -2
- package/dist/helpers/use-external-examples.d.ts +1 -1
- package/dist/helpers/use-external-examples.js +1 -1
- package/dist/mutators/index.js +10 -10
- package/dist/mutators/operation/helpers/sync-path-parameters.js +1 -1
- package/dist/mutators/operation/index.js +5 -5
- package/dist/mutators/operation/operation.js +1 -1
- package/dist/navigation/get-navigation-options.d.ts +1 -1
- package/dist/navigation/helpers/get-navigation-tag-names.d.ts +1 -1
- package/dist/navigation/helpers/get-tag.d.ts +1 -1
- package/dist/navigation/helpers/traverse-asyncapi-document.d.ts +1 -1
- package/dist/navigation/helpers/traverse-asyncapi-document.d.ts.map +1 -1
- package/dist/navigation/helpers/traverse-asyncapi-document.js +10 -17
- package/dist/navigation/helpers/traverse-description.d.ts +1 -1
- package/dist/navigation/helpers/traverse-description.js +1 -1
- package/dist/navigation/helpers/traverse-document.d.ts +1 -1
- package/dist/navigation/helpers/traverse-document.js +1 -1
- package/dist/navigation/helpers/traverse-paths.d.ts +1 -1
- package/dist/navigation/helpers/traverse-paths.js +1 -1
- package/dist/navigation/helpers/traverse-schemas.d.ts +1 -1
- package/dist/navigation/helpers/traverse-schemas.js +2 -2
- package/dist/navigation/helpers/traverse-tags.d.ts +1 -1
- package/dist/navigation/helpers/traverse-tags.js +2 -2
- package/dist/navigation/helpers/traverse-webhooks.d.ts +1 -1
- package/dist/navigation/helpers/traverse-webhooks.js +1 -1
- package/dist/navigation/helpers/update-order-ids.js +2 -2
- package/dist/navigation/helpers/utils.d.ts +1 -1
- package/dist/persistence/index.js +3 -3
- package/dist/persistence/migrations/v1-initial.d.ts +1 -1
- package/dist/persistence/migrations/v2-team-to-local.d.ts +1 -1
- package/dist/plugins/bundler/index.js +1 -1
- package/dist/request-example/builder/body/get-request-body-example.js +3 -3
- package/dist/request-example/builder/build-request.d.ts +2 -2
- package/dist/request-example/builder/build-request.js +5 -5
- package/dist/request-example/builder/header/build-request-parameters.js +1 -1
- package/dist/request-example/builder/header/is-param-disabled.js +1 -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 +34 -1
- package/dist/request-example/builder/helpers/get-resolved-url.js +1 -1
- package/dist/request-example/builder/request-factory.d.ts +3 -3
- package/dist/request-example/builder/request-factory.js +2 -2
- package/dist/request-example/builder/resolve-request-factory-url.d.ts +1 -1
- package/dist/request-example/builder/security/build-request-security.d.ts +1 -1
- package/dist/request-example/builder/security/secret-types.d.ts +1 -1
- package/dist/request-example/context/get-request-example-context.d.ts +4 -4
- package/dist/request-example/context/get-request-example-context.js +9 -9
- package/dist/request-example/context/headers.js +2 -2
- package/dist/request-example/context/security/extract-security-scheme-secrets.d.ts +1 -1
- package/dist/request-example/context/security/get-security-schemes.d.ts +2 -2
- package/dist/request-example/context/security/merge-security.d.ts +1 -1
- package/dist/request-example/context/security/merge-security.js +1 -1
- package/dist/request-example/variable-store/index.d.ts +1 -1
- package/dist/schemas/extensions/tag/x-tag-groups.d.ts +1 -1
- package/dist/schemas/extensions/tag/x-tag-groups.js +2 -2
- package/dist/schemas/inmemory-workspace.d.ts +1 -1
- package/dist/schemas/navigation.d.ts +5 -5
- package/dist/schemas/navigation.js +2 -2
- package/dist/schemas/reference-config/settings.d.ts +1 -1
- package/dist/schemas/reference-config/settings.js +1 -1
- package/dist/schemas/v3.1/strict/example.js +2 -2
- package/dist/schemas/v3.1/strict/header.js +1 -1
- package/dist/schemas/v3.1/strict/info.d.ts +2 -2
- package/dist/schemas/v3.1/strict/info.js +3 -3
- package/dist/schemas/v3.1/strict/link.js +1 -1
- package/dist/schemas/v3.1/strict/oauth-flow.d.ts +8 -8
- package/dist/schemas/v3.1/strict/oauth-flow.js +9 -9
- package/dist/schemas/v3.1/strict/oauthflows.d.ts +1 -1
- package/dist/schemas/v3.1/strict/oauthflows.js +1 -1
- package/dist/schemas/v3.1/strict/openapi-document.d.ts +17 -17
- package/dist/schemas/v3.1/strict/openapi-document.js +18 -18
- package/dist/schemas/v3.1/strict/operation.d.ts +10 -10
- package/dist/schemas/v3.1/strict/operation.js +11 -11
- package/dist/schemas/v3.1/strict/parameter.d.ts +6 -6
- package/dist/schemas/v3.1/strict/parameter.js +6 -6
- package/dist/schemas/v3.1/strict/reference.js +1 -1
- package/dist/schemas/v3.1/strict/request-body.d.ts +1 -1
- package/dist/schemas/v3.1/strict/request-body.js +2 -2
- package/dist/schemas/v3.1/strict/response.d.ts +2 -2
- package/dist/schemas/v3.1/strict/schema.d.ts +11 -11
- package/dist/schemas/v3.1/strict/schema.js +10 -10
- package/dist/schemas/v3.1/strict/security-scheme.d.ts +3 -3
- package/dist/schemas/v3.1/strict/security-scheme.js +4 -4
- package/dist/schemas/v3.1/strict/tag.d.ts +4 -4
- package/dist/schemas/v3.1/strict/tag.js +5 -5
- package/dist/schemas/v3.1/strict/type-guards.d.ts +2 -2
- package/dist/schemas/v3.2/openapi/index.js +43 -43
- package/dist/schemas/v3.2/strict/example.js +2 -2
- package/dist/schemas/v3.2/strict/header.js +1 -1
- package/dist/schemas/v3.2/strict/info.d.ts +2 -2
- package/dist/schemas/v3.2/strict/info.js +3 -3
- package/dist/schemas/v3.2/strict/link.js +1 -1
- package/dist/schemas/v3.2/strict/oauth-flow.d.ts +8 -8
- package/dist/schemas/v3.2/strict/oauth-flow.js +9 -9
- package/dist/schemas/v3.2/strict/openapi-document.d.ts +17 -17
- package/dist/schemas/v3.2/strict/openapi-document.js +18 -18
- package/dist/schemas/v3.2/strict/operation.d.ts +10 -10
- package/dist/schemas/v3.2/strict/operation.js +11 -11
- package/dist/schemas/v3.2/strict/parameter.d.ts +6 -6
- package/dist/schemas/v3.2/strict/parameter.js +6 -6
- package/dist/schemas/v3.2/strict/reference.js +1 -1
- package/dist/schemas/v3.2/strict/request-body.d.ts +1 -1
- package/dist/schemas/v3.2/strict/request-body.js +2 -2
- package/dist/schemas/v3.2/strict/response.d.ts +2 -2
- package/dist/schemas/v3.2/strict/schema.d.ts +11 -11
- package/dist/schemas/v3.2/strict/schema.js +10 -10
- package/dist/schemas/v3.2/strict/security-scheme.d.ts +3 -3
- package/dist/schemas/v3.2/strict/security-scheme.js +4 -4
- package/dist/schemas/v3.2/strict/tag.d.ts +4 -4
- package/dist/schemas/v3.2/strict/tag.js +5 -5
- package/dist/schemas/v3.2/strict/type-guards.d.ts +2 -2
- package/dist/schemas/workspace-specification/index.d.ts +3 -3
- package/dist/schemas/workspace-specification/index.js +3 -3
- package/dist/schemas/workspace.d.ts +7 -7
- package/dist/schemas/workspace.js +8 -8
- package/package.json +15 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @scalar/workspace-store
|
|
2
2
|
|
|
3
|
+
## 0.69.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#10696](https://github.com/scalar/scalar/pull/10696): Upgrade Undici to 8.12.3. JSON Magic, Mock Server, Workspace Store, OpenAPI to Markdown, and Scalar App now require Node.js 22.19.0 or later; Node.js 22.0 through 22.18 are no longer supported. Undici 8 enables HTTP/2 by default.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- [#10687](https://github.com/scalar/scalar/pull/10687): Display operation-level AsyncAPI message payload examples in a dark code card with message and example selection, plus selectable reply payload examples below it. Keep message and reply schemas in the left column.
|
|
12
|
+
|
|
13
|
+
Preserve declared AsyncAPI message order in the documentation and example picker.
|
|
14
|
+
|
|
15
|
+
- [#10721](https://github.com/scalar/scalar/pull/10721): Update compatible dependencies while retaining the existing Node.js support and five-day release-age policy.
|
|
16
|
+
- [#10702](https://github.com/scalar/scalar/pull/10702): Preserve security schemes when expanding a compact chunk index, allowing authentication definitions to load with the initial document. Existing security schemes take precedence over chunk references with the same name.
|
|
17
|
+
- [#10723](https://github.com/scalar/scalar/pull/10723): List AsyncAPI reply messages that live on the operation's own channel only under Replies, instead of repeating them under Messages or Other Channel Messages.
|
|
18
|
+
|
|
19
|
+
## 0.68.5
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- [#10677](https://github.com/scalar/scalar/pull/10677): Generate serialized JSON examples from `contentSchema` instead of falling back to `null`, including JSON media type parameters, structured JSON suffixes, and string type arrays.
|
|
24
|
+
|
|
3
25
|
## 0.68.4
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AuthenticationConfiguration } from '@scalar/types/api-reference';
|
|
2
|
-
import type { BuildChannelConnectionContext, ChannelConnectionMeta } from '
|
|
2
|
+
import type { BuildChannelConnectionContext, ChannelConnectionMeta } from './types.js';
|
|
3
3
|
import type { WorkspaceStore } from '../client.js';
|
|
4
4
|
import type { Result } from '../request-example/types.js';
|
|
5
5
|
import type { WorkspaceDocument } from '../schemas/workspace.js';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { buildConnectionUrl } from '
|
|
2
|
-
import { getAllChannelMessages } from '
|
|
3
|
-
import { getAsyncApiSecuritySchemes } from '
|
|
4
|
-
import { getChannelConnectionSecurityRequirements } from '
|
|
5
|
-
import { getChannelOperations } from '
|
|
6
|
-
import { getChannelParameters } from '
|
|
7
|
-
import { resolveChannel } from '
|
|
8
|
-
import { getAsyncApiServers, getSelectedAsyncApiServer } from '
|
|
1
|
+
import { buildConnectionUrl } from './build-connection-url.js';
|
|
2
|
+
import { getAllChannelMessages } from './get-all-channel-messages.js';
|
|
3
|
+
import { getAsyncApiSecuritySchemes } from './get-asyncapi-security-requirements.js';
|
|
4
|
+
import { getChannelConnectionSecurityRequirements } from './get-channel-connection-security.js';
|
|
5
|
+
import { getChannelOperations } from './get-channel-operations.js';
|
|
6
|
+
import { getChannelParameters } from './get-channel-parameters.js';
|
|
7
|
+
import { resolveChannel } from './resolve-channel.js';
|
|
8
|
+
import { getAsyncApiServers, getSelectedAsyncApiServer } from './servers.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';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getAsyncApiSecurityRequirements } from '
|
|
1
|
+
import { getAsyncApiSecurityRequirements } from './get-asyncapi-security-requirements.js';
|
|
2
2
|
/**
|
|
3
3
|
* Connection authentication belongs to the selected server; operation security is documented separately.
|
|
4
4
|
* Keep the channel arguments for compatibility with existing consumers of this public helper.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { objectEntries } from '@scalar/helpers/object/object-entries';
|
|
2
2
|
import { findVariables } from '@scalar/helpers/regex/find-variables';
|
|
3
|
-
import { buildWsQueryParams, mergeWsBindings } from '
|
|
3
|
+
import { buildWsQueryParams, mergeWsBindings } from './build-connection-url.js';
|
|
4
4
|
import { getResolvedAsyncApiRef } from '../helpers/get-resolved-async-api-ref.js';
|
|
5
5
|
const getPathParameterNames = (address) => {
|
|
6
6
|
if (address == null || address === '') {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AsyncApiChannelObject, AsyncApiDocument, AsyncApiOperationObject, AsyncApiServerObject } from '@scalar/types/asyncapi/3.1';
|
|
2
|
-
import { type BuildConnectionUrlInput } from '
|
|
2
|
+
import { type BuildConnectionUrlInput } from './build-connection-url.js';
|
|
3
3
|
import type { WorkspaceDocument } from '../schemas/workspace.js';
|
|
4
4
|
export type AsyncApiServerListOptions = {
|
|
5
5
|
channel?: AsyncApiChannelObject | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { objectEntries } from '@scalar/helpers/object/object-entries';
|
|
2
|
-
import { buildAsyncApiServerBaseUrl, buildConnectionUrl, isWebSocketProtocol, } from '
|
|
2
|
+
import { buildAsyncApiServerBaseUrl, buildConnectionUrl, isWebSocketProtocol, } from './build-connection-url.js';
|
|
3
3
|
import { getNameFromRef } from '../helpers/get-name-from-ref.js';
|
|
4
4
|
import { getResolvedAsyncApiRef } from '../helpers/get-resolved-async-api-ref.js';
|
|
5
5
|
import { isAsyncApiDocument } from '../schemas/type-guards.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PartialDeep } from 'type-fest';
|
|
2
|
-
import { type DocumentAuth, type SecretsAuthUnion, type SelectedSecurity } from '
|
|
2
|
+
import { type DocumentAuth, type SecretsAuthUnion, type SelectedSecurity } from './schema.js';
|
|
3
3
|
export type { Auth, SecretsApiKey, SecretsAuth, SecretsAuthUnion, SecretsEncryption, SecretsGssapi, SecretsHttp, SecretsOAuth, SecretsOAuthFlows, SecretsOpenIdConnect, SecretsSasl, SecretsX509, SelectedSecurity, } from './schema.js';
|
|
4
4
|
export { AuthSchema, OpenIDConnectSchema, SecretsAuthSchema, } from './schema.js';
|
|
5
5
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { preventPollution } from '@scalar/helpers/object/prevent-pollution';
|
|
2
2
|
import { reactive } from 'vue';
|
|
3
|
-
import { DocumentAuthSchema, SecretsAuthUnionSchema, } from '
|
|
3
|
+
import { DocumentAuthSchema, SecretsAuthUnionSchema, } from './schema.js';
|
|
4
4
|
import { safeAssign } from '../../helpers/general.js';
|
|
5
5
|
import { unpackProxyObject } from '../../helpers/unpack-proxy.js';
|
|
6
6
|
import { coerceValue } from '../../schemas/typebox-coerce.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type DocumentHistory, type HistoryEntry } from '
|
|
1
|
+
import { type DocumentHistory, type HistoryEntry } from './schema.js';
|
|
2
2
|
/**
|
|
3
3
|
* Interface for the HistoryStore.
|
|
4
4
|
* Provides methods to manage and retrieve request/response history for API operations within a document.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { reactive } from 'vue';
|
|
2
|
-
import { DocumentHistorySchema } from '
|
|
2
|
+
import { DocumentHistorySchema } from './schema.js';
|
|
3
3
|
import { safeAssign } from '../../helpers/general.js';
|
|
4
4
|
import { unpackProxyObject } from '../../helpers/unpack-proxy.js';
|
|
5
5
|
import { coerceValue } from '../../schemas/typebox-coerce.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CollectionType } from '
|
|
1
|
+
import type { CollectionType } from './common.js';
|
|
2
2
|
import type { XScalarCookie } from '../../schemas/extensions/general/x-scalar-cookies.js';
|
|
3
3
|
/** Event definitions for all things cookie related */
|
|
4
4
|
export type CookieEvents = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CollectionType } from '
|
|
1
|
+
import type { CollectionType } from './common.js';
|
|
2
2
|
import type { XScalarEnvVar, XScalarEnvironment } from '../../schemas/extensions/document/x-scalar-environments.js';
|
|
3
3
|
/** Event definitions for all things environment related */
|
|
4
4
|
export type EnvironmentEvents = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { OperationExampleMeta } from '
|
|
1
|
+
import type { OperationExampleMeta } from './operation.js';
|
|
2
2
|
import type { RequestPayload } from '../../request-example/builder/build-request.js';
|
|
3
3
|
/**
|
|
4
4
|
* Event definitions for hooking into the API client lifecycle.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { EnvironmentEvents } from '
|
|
2
|
-
import type { HooksEvents } from '
|
|
3
|
-
import type { TabEvents } from '
|
|
4
|
-
import type { TagEvents } from '
|
|
5
|
-
import type { WorkspaceEvents } from '
|
|
1
|
+
import type { EnvironmentEvents } from './environment.js';
|
|
2
|
+
import type { HooksEvents } from './hooks.js';
|
|
3
|
+
import type { TabEvents } from './tabs.js';
|
|
4
|
+
import type { TagEvents } from './tag.js';
|
|
5
|
+
import type { WorkspaceEvents } from './workspace.js';
|
|
6
6
|
import type { AnalyticsEvents } from './analytics.js';
|
|
7
7
|
import type { AuthEvents } from './auth.js';
|
|
8
8
|
import type { CookieEvents } from './cookie.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { escapeJsonPointer } from '@scalar/json-magic/helpers/escape-json-pointer';
|
|
2
|
-
import { encodeChunkName } from '
|
|
2
|
+
import { encodeChunkName } from './encode-chunk-name.js';
|
|
3
3
|
/** Model pages use singleton chunks instead of the groups consumed by channel pages. */
|
|
4
4
|
export const asyncApiModelChunkReference = (reference, name) => {
|
|
5
5
|
const section =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AAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;CAC/C,KAAG,UAYF,CAAA;AAUF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,gBAAgB,GAAI,UAAU,OAAO,KAAG,OA8DpD,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isHttpMethod } from '@scalar/helpers/http/is-http-method';
|
|
2
2
|
import { isObject } from '@scalar/helpers/object/is-object';
|
|
3
3
|
import { escapeJsonPointer } from '@scalar/json-magic/helpers/escape-json-pointer';
|
|
4
|
-
import { encodeChunkName } from '
|
|
4
|
+
import { encodeChunkName } from './encode-chunk-name.js';
|
|
5
5
|
/**
|
|
6
6
|
* The extension key a compact sparse document carries its chunk index under.
|
|
7
7
|
*
|
|
@@ -152,6 +152,14 @@ export const expandChunkIndex = (document) => {
|
|
|
152
152
|
: value,
|
|
153
153
|
])),
|
|
154
154
|
]));
|
|
155
|
+
// Keep authentication available without fetching a separate security-scheme chunk.
|
|
156
|
+
const securitySchemes = isObject(document['components']) ? document['components']['securitySchemes'] : undefined;
|
|
157
|
+
if (isObject(securitySchemes)) {
|
|
158
|
+
components['securitySchemes'] = {
|
|
159
|
+
...components['securitySchemes'],
|
|
160
|
+
...securitySchemes,
|
|
161
|
+
};
|
|
162
|
+
}
|
|
155
163
|
document['components'] = components;
|
|
156
164
|
document['paths'] = paths;
|
|
157
165
|
delete document[CHUNK_INDEX_KEY];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isObject } from '@scalar/helpers/object/is-object';
|
|
2
|
-
import { getResolvedRef, mergeSiblingReferences } from '
|
|
3
|
-
import { unpackProxyObject } from '
|
|
2
|
+
import { getResolvedRef, mergeSiblingReferences } from './get-resolved-ref.js';
|
|
3
|
+
import { unpackProxyObject } from './unpack-proxy.js';
|
|
4
4
|
/** Narrow a schema to one that carries a `$dynamicRef`. */
|
|
5
5
|
export const isDynamicRef = (schema) => typeof schema === 'object' && schema !== null && '$dynamicRef' in schema && typeof schema.$dynamicRef === 'string';
|
|
6
6
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type NodeInput } from '
|
|
1
|
+
import { type NodeInput } from './get-resolved-ref.js';
|
|
2
2
|
import type { OperationObject } from '../schemas/v3.2/strict/operation.js';
|
|
3
3
|
import type { PathItemObject } from '../schemas/v3.2/strict/path-item.js';
|
|
4
4
|
/**
|
|
@@ -2,7 +2,7 @@ import { isHttpMethod } from '@scalar/helpers/http/is-http-method';
|
|
|
2
2
|
import { isObjectLike } from '@scalar/helpers/object/is-object';
|
|
3
3
|
import { preventPollution } from '@scalar/helpers/object/prevent-pollution';
|
|
4
4
|
import { escapeJsonPointer } from '@scalar/json-magic/helpers/escape-json-pointer';
|
|
5
|
-
import { getResolvedRef, mergeSiblingReferences } from '
|
|
5
|
+
import { getResolvedRef, mergeSiblingReferences } from './get-resolved-ref.js';
|
|
6
6
|
/**
|
|
7
7
|
* How many `$ref` hops to follow before treating a chain as circular.
|
|
8
8
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseMimeType } from '@scalar/helpers/http/mime-type';
|
|
2
|
-
import { getResolvedRef } from '
|
|
2
|
+
import { getResolvedRef } from './get-resolved-ref.js';
|
|
3
3
|
/** Select an explicit example without confusing false, zero, null, or empty text with absence. */
|
|
4
4
|
export const getExampleValue = (input) => {
|
|
5
5
|
const example = getResolvedRef(input);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getFirstMediaType } from '@scalar/helpers/http/get-first-media-type';
|
|
2
|
-
import { getExampleValue, getExplicitExampleText } from '
|
|
2
|
+
import { getExampleValue, getExplicitExampleText } from './get-example-value.js';
|
|
3
3
|
import { getExample } from '../request-example/builder/helpers/get-example.js';
|
|
4
4
|
/** Resolve new and legacy example fields without serializing parameter-level wire text again. */
|
|
5
5
|
export const getParameterExample = (parameter, exampleName) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getResolvedRef } from '
|
|
1
|
+
import { getResolvedRef } from './get-resolved-ref.js';
|
|
2
2
|
import { getExample } from '../request-example/builder/helpers/get-example.js';
|
|
3
3
|
/** The request body and parameter examples needed by a single request, never its responses. */
|
|
4
4
|
export const getOperationExamples = (operation, key, contentType) => {
|
|
@@ -3,7 +3,7 @@ import { isJsonMediaType } from '@scalar/helpers/http/is-json-media-type';
|
|
|
3
3
|
import { parseMimeType } from '@scalar/helpers/http/mime-type';
|
|
4
4
|
import { isObject } from '@scalar/helpers/object/is-object';
|
|
5
5
|
import { replaceEnvVariables } from '@scalar/helpers/regex/replace-variables';
|
|
6
|
-
import { getResolvedRef } from '
|
|
6
|
+
import { getResolvedRef } from './get-resolved-ref.js';
|
|
7
7
|
import { serializeFormPropertyWithEncoding } from '../request-example/builder/body/serialize-form-property.js';
|
|
8
8
|
import { isParamDisabled } from '../request-example/builder/header/is-param-disabled.js';
|
|
9
9
|
import { applyAllowReservedToUrl } from '../request-example/builder/helpers/apply-allow-reserved-to-url.js';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { SchemaObject } from '../schemas/v3.2/strict/openapi-document.js';
|
|
2
|
+
/** Keep non-JSON schema languages out of JSON Schema rendering and traversal. */
|
|
3
|
+
export declare const isAsyncApiJsonSchemaFormat: (format: unknown) => boolean;
|
|
4
|
+
/** A schema that can use the shared renderer, or source in another schema language. */
|
|
5
|
+
type AsyncApiSchema = {
|
|
6
|
+
kind: 'schema';
|
|
7
|
+
schema: SchemaObject;
|
|
8
|
+
} | {
|
|
9
|
+
kind: 'source';
|
|
10
|
+
format: string;
|
|
11
|
+
value: unknown;
|
|
12
|
+
};
|
|
13
|
+
/** Resolve the wrapper and its schema without discarding the declared schema language. */
|
|
14
|
+
export declare const resolveAsyncApiSchema: (value: unknown) => AsyncApiSchema | undefined;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=resolve-async-api-schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-async-api-schema.d.ts","sourceRoot":"","sources":["../../src/helpers/resolve-async-api-schema.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAA;AAK3E,iFAAiF;AACjF,eAAO,MAAM,0BAA0B,GAAI,QAAQ,OAAO,KAAG,OAkB5D,CAAA;AAED,uFAAuF;AACvF,KAAK,cAAc,GAAG;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,YAAY,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAAA;AAEnH,0FAA0F;AAC1F,eAAO,MAAM,qBAAqB,GAAI,OAAO,OAAO,KAAG,cAAc,GAAG,SAgBvE,CAAA"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { isObject } from '@scalar/helpers/object/is-object';
|
|
2
|
+
import { getAsyncApiSchemaView } from './get-async-api-schema-view.js';
|
|
3
|
+
import { getBooleanSchema } from './get-boolean-schema.js';
|
|
4
|
+
import { getResolvedAsyncApiRef } from './get-resolved-async-api-ref.js';
|
|
5
|
+
/** Keep non-JSON schema languages out of JSON Schema rendering and traversal. */
|
|
6
|
+
export const isAsyncApiJsonSchemaFormat = (format) => {
|
|
7
|
+
if (format === undefined) {
|
|
8
|
+
return true;
|
|
9
|
+
}
|
|
10
|
+
if (typeof format !== 'string') {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
const mediaType = format.split(';')[0]?.trim().toLowerCase();
|
|
14
|
+
return [
|
|
15
|
+
'application/schema+json',
|
|
16
|
+
'application/schema+yaml',
|
|
17
|
+
'application/vnd.aai.asyncapi',
|
|
18
|
+
'application/vnd.aai.asyncapi+json',
|
|
19
|
+
'application/vnd.aai.asyncapi+yaml',
|
|
20
|
+
'application/vnd.oai.openapi',
|
|
21
|
+
'application/vnd.oai.openapi+json',
|
|
22
|
+
'application/vnd.oai.openapi+yaml',
|
|
23
|
+
].includes(mediaType ?? '');
|
|
24
|
+
};
|
|
25
|
+
/** Resolve the wrapper and its schema without discarding the declared schema language. */
|
|
26
|
+
export const resolveAsyncApiSchema = (value) => {
|
|
27
|
+
const resolved = getResolvedAsyncApiRef(value);
|
|
28
|
+
const wrapped = isObject(resolved) && 'schemaFormat' in resolved;
|
|
29
|
+
const schema = wrapped ? getResolvedAsyncApiRef(resolved.schema) : resolved;
|
|
30
|
+
if (schema === undefined) {
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
33
|
+
if (wrapped && !isAsyncApiJsonSchemaFormat(resolved.schemaFormat)) {
|
|
34
|
+
return { kind: 'source', format: String(resolved.schemaFormat), value: schema };
|
|
35
|
+
}
|
|
36
|
+
if (typeof schema === 'boolean') {
|
|
37
|
+
return { kind: 'schema', schema: getBooleanSchema(schema) };
|
|
38
|
+
}
|
|
39
|
+
const view = getAsyncApiSchemaView(schema, wrapped ? String(resolved.schemaFormat) : undefined);
|
|
40
|
+
// AsyncAPI and OpenAPI schemas share the object renderer, whose type requires a `type` field.
|
|
41
|
+
return isObject(view) ? { kind: 'schema', schema: view } : undefined;
|
|
42
|
+
};
|
|
@@ -5,8 +5,8 @@ import { isSchemaPath } from '@scalar/helpers/openapi/is-schema-path';
|
|
|
5
5
|
import { bundle, resolveReferencePath } from '@scalar/json-magic/bundle';
|
|
6
6
|
import { createMagicProxy } from '@scalar/json-magic/magic-proxy';
|
|
7
7
|
import { Value } from '@scalar/typebox/value';
|
|
8
|
-
import { generateUniqueValue } from '
|
|
9
|
-
import { getResolvedRef } from '
|
|
8
|
+
import { generateUniqueValue } from './generate-unique-value.js';
|
|
9
|
+
import { getResolvedRef } from './get-resolved-ref.js';
|
|
10
10
|
import { normalizeAuthSchemes } from '../plugins/bundler/index.js';
|
|
11
11
|
import { resolveOpenApiDocument } from '../plugins/bundler/openapi-document.js';
|
|
12
12
|
import { SecuritySchemeObjectSchema } from '../schemas/v3.2/strict/openapi-document.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { unpackProxyShallow } from '
|
|
1
|
+
import { unpackProxyShallow } from './unpack-proxy.js';
|
|
2
2
|
/**
|
|
3
3
|
* Snapshot each schema object once, retaining shared and recursive references.
|
|
4
4
|
* Unpacking is shallow: use the raw object only for identity and ownership, then
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getRaw } from '@scalar/json-magic/magic-proxy';
|
|
2
2
|
import { toRaw } from 'vue';
|
|
3
|
-
import { unpackDetectChangesProxy } from '
|
|
4
|
-
import { unpackOverridesProxy } from '
|
|
3
|
+
import { unpackDetectChangesProxy } from './detect-changes-proxy.js';
|
|
4
|
+
import { unpackOverridesProxy } from './overrides-proxy.js';
|
|
5
5
|
/**
|
|
6
6
|
* Unpacks special vue reactivity & override & detect-changes & magic proxy from an input object or array,
|
|
7
7
|
* returning the "raw" plain object or array.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ComponentPublicInstance, type ComputedRef, type InjectionKey, type Ref } from 'vue';
|
|
2
|
-
import { type ExternalExampleResolver } from '
|
|
2
|
+
import { type ExternalExampleResolver } from './external-examples.js';
|
|
3
3
|
import type { ExampleObject } from '../schemas/v3.2/strict/openapi-document.js';
|
|
4
4
|
/** Supply the current document's resolver so consumers share downloads and invalidation. */
|
|
5
5
|
export declare const EXTERNAL_EXAMPLES: InjectionKey<() => ExternalExampleResolver>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { computed, inject, onScopeDispose, ref, watch, watchEffect, } from 'vue';
|
|
2
|
-
import { createExternalExampleResolver } from '
|
|
2
|
+
import { createExternalExampleResolver } from './external-examples.js';
|
|
3
3
|
/** Supply the current document's resolver so consumers share downloads and invalidation. */
|
|
4
4
|
export const EXTERNAL_EXAMPLES = Symbol('external-examples');
|
|
5
5
|
/** Observe current visibility, rather than mounting, to avoid fetching every operation on a long page. */
|
package/dist/mutators/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { authMutatorsFactory } from '
|
|
2
|
-
import { cookieMutatorsFactory } from '
|
|
3
|
-
import { documentMutatorsFactory } from '
|
|
4
|
-
import { environmentMutatorsFactory } from '
|
|
5
|
-
import { getDocument } from '
|
|
6
|
-
import { operationMutatorsFactory } from '
|
|
7
|
-
import { serverMutatorsFactory } from '
|
|
8
|
-
import { tabsMutatorsFactory } from '
|
|
9
|
-
import { tagMutatorsFactory } from '
|
|
10
|
-
import { workspaceMutatorsFactory } from '
|
|
1
|
+
import { authMutatorsFactory } from './auth.js';
|
|
2
|
+
import { cookieMutatorsFactory } from './cookie.js';
|
|
3
|
+
import { documentMutatorsFactory } from './document.js';
|
|
4
|
+
import { environmentMutatorsFactory } from './environment.js';
|
|
5
|
+
import { getDocument } from './helpers.js';
|
|
6
|
+
import { operationMutatorsFactory } from './operation/index.js';
|
|
7
|
+
import { serverMutatorsFactory } from './server.js';
|
|
8
|
+
import { tabsMutatorsFactory } from './tabs.js';
|
|
9
|
+
import { tagMutatorsFactory } from './tag.js';
|
|
10
|
+
import { workspaceMutatorsFactory } from './workspace.js';
|
|
11
11
|
/**
|
|
12
12
|
* Generates a set of mutators for managing OpenAPI document and workspace state.
|
|
13
13
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { findVariables } from '@scalar/helpers/regex/find-variables';
|
|
2
2
|
import { unpackProxyObject } from '../../../helpers/unpack-proxy.js';
|
|
3
|
-
import { getParameterPositions } from '
|
|
3
|
+
import { getParameterPositions } from './get-parameter-position.js';
|
|
4
4
|
/**
|
|
5
5
|
* Synchronizes path parameters when a path string changes.
|
|
6
6
|
*
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { updateOperationRequestBodyContentType, updateOperationRequestBodyExample, updateOperationRequestBodyFormValue, } from '
|
|
2
|
-
import { updateOperationExtension } from '
|
|
3
|
-
import { addResponseToHistory, reloadOperationHistory } from '
|
|
4
|
-
import { createOperation, createOperationDraftExample, deleteOperation, deleteOperationExample, renameOperationExample, updateOperationMeta, updateOperationPathMethod, } from '
|
|
5
|
-
import { deleteAllOperationParameters, deleteOperationParameter, updateOperationExtraParameters, upsertOperationParameter, } from '
|
|
1
|
+
import { updateOperationRequestBodyContentType, updateOperationRequestBodyExample, updateOperationRequestBodyFormValue, } from './body.js';
|
|
2
|
+
import { updateOperationExtension } from './extensions.js';
|
|
3
|
+
import { addResponseToHistory, reloadOperationHistory } from './history.js';
|
|
4
|
+
import { createOperation, createOperationDraftExample, deleteOperation, deleteOperationExample, renameOperationExample, updateOperationMeta, updateOperationPathMethod, } from './operation.js';
|
|
5
|
+
import { deleteAllOperationParameters, deleteOperationParameter, updateOperationExtraParameters, upsertOperationParameter, } from './parameters.js';
|
|
6
6
|
export const operationMutatorsFactory = ({ document, store, }) => {
|
|
7
7
|
return {
|
|
8
8
|
createOperation: (payload) => createOperation(store, payload),
|
|
@@ -3,7 +3,7 @@ import { findVariables } from '@scalar/helpers/regex/find-variables';
|
|
|
3
3
|
import { deletePathItemOperation, getPathItemOperation, pathItemIsEmpty, setPathItemOperation, } from '../../helpers/for-each-path-item-operation.js';
|
|
4
4
|
import { getResolvedRef } from '../../helpers/get-resolved-ref.js';
|
|
5
5
|
import { unpackProxyObject } from '../../helpers/unpack-proxy.js';
|
|
6
|
-
import { syncParametersForPathChange } from '
|
|
6
|
+
import { syncParametersForPathChange } from './helpers/sync-path-parameters.js';
|
|
7
7
|
import { getOperationEntries } from '../../navigation/index.js';
|
|
8
8
|
import { getNavigationOptions } from '../../navigation/get-navigation-options.js';
|
|
9
9
|
import { updateOrderIds } from '../../navigation/helpers/update-order-ids.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ApiReferenceConfigurationRaw } from '@scalar/types/api-reference';
|
|
2
|
-
import type { TraverseSpecOptions } from '
|
|
2
|
+
import type { TraverseSpecOptions } from './types.js';
|
|
3
3
|
export type NavigationOptions = Partial<Pick<ApiReferenceConfigurationRaw, 'generateHeadingSlug' | 'generateTagSlug' | 'generateOperationSlug' | 'generateWebhookSlug' | 'generateModelSlug' | 'operationsSorter' | 'tagsSorter' | 'hideModels' | 'modelsSectionLabel' | 'operationTitleSource'>> | undefined;
|
|
4
4
|
/**
|
|
5
5
|
* Returns options for traversing an OpenAPI document, allowing customization of
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TagsMap } from '
|
|
1
|
+
import type { TagsMap } from '../types.js';
|
|
2
2
|
import type { OpenApiDocument } from '../../schemas/v3.2/strict/openapi-document.js';
|
|
3
3
|
/** Label tags must not create operation groups, but undeclared tags still do. */
|
|
4
4
|
export declare const getNavigationTagNames: (document: OpenApiDocument, names: string[] | undefined, tagsMap: TagsMap) => string[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TagsMap, TraverseSpecOptions } from '
|
|
1
|
+
import type { TagsMap, TraverseSpecOptions } from '../types.js';
|
|
2
2
|
type TagMapValue = NonNullable<TagsMap extends Map<string, infer V> ? V : never>;
|
|
3
3
|
/**
|
|
4
4
|
* Gets or creates a tag in the tags dictionary.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AsyncApiDocument } from '@scalar/types/asyncapi/3.1';
|
|
2
|
-
import { type NavigationOptions } from '
|
|
2
|
+
import { type NavigationOptions } from '../get-navigation-options.js';
|
|
3
3
|
import type { TraversedDocument } from '../../schemas/navigation.js';
|
|
4
4
|
/** AsyncAPI document plus Scalar navigation extensions written during traversal. */
|
|
5
5
|
type AsyncApiDocumentWithNavigationExtensions = AsyncApiDocument & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"traverse-asyncapi-document.d.ts","sourceRoot":"","sources":["../../../src/navigation/helpers/traverse-asyncapi-document.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAyB,gBAAgB,EAA2B,MAAM,4BAA4B,CAAA;AAOlH,OAAO,EAAE,KAAK,iBAAiB,EAAwB,MAAM,qCAAqC,CAAA;AAQlG,OAAO,KAAK,EAKV,iBAAiB,EAGlB,MAAM,sBAAsB,CAAA;AAM7B,oFAAoF;AACpF,KAAK,wCAAwC,GAAG,gBAAgB,GAAG;IACjE,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB,CAAA;
|
|
1
|
+
{"version":3,"file":"traverse-asyncapi-document.d.ts","sourceRoot":"","sources":["../../../src/navigation/helpers/traverse-asyncapi-document.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAyB,gBAAgB,EAA2B,MAAM,4BAA4B,CAAA;AAOlH,OAAO,EAAE,KAAK,iBAAiB,EAAwB,MAAM,qCAAqC,CAAA;AAQlG,OAAO,KAAK,EAKV,iBAAiB,EAGlB,MAAM,sBAAsB,CAAA;AAM7B,oFAAoF;AACpF,KAAK,wCAAwC,GAAG,gBAAgB,GAAG;IACjE,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB,CAAA;AA4iBD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,wBAAwB,GACnC,cAAc,MAAM,EACpB,UAAU,wCAAwC,EAClD,UAAU,iBAAiB,KAC1B,iBAsJF,CAAA"}
|
|
@@ -5,11 +5,11 @@ import { getNameFromRef } from '../../helpers/get-name-from-ref.js';
|
|
|
5
5
|
import { getResolvedAsyncApiRef } from '../../helpers/get-resolved-async-api-ref.js';
|
|
6
6
|
import { isHidden } from '../../helpers/is-hidden.js';
|
|
7
7
|
import { unpackProxyObject } from '../../helpers/unpack-proxy.js';
|
|
8
|
-
import { getNavigationOptions } from '
|
|
9
|
-
import { getTag } from '
|
|
10
|
-
import { getTagExternalDocs } from '
|
|
11
|
-
import { traverseDescription } from '
|
|
12
|
-
import { traverseSchemas } from '
|
|
8
|
+
import { getNavigationOptions } from '../get-navigation-options.js';
|
|
9
|
+
import { getTag } from './get-tag.js';
|
|
10
|
+
import { getTagExternalDocs } from './get-tag-external-docs.js';
|
|
11
|
+
import { traverseDescription } from './traverse-description.js';
|
|
12
|
+
import { traverseSchemas } from './traverse-schemas.js';
|
|
13
13
|
/**
|
|
14
14
|
* Picks the first display candidate that is non-empty after trimming.
|
|
15
15
|
* Used by title helpers so we prefer `title`, then `summary`, then a fallback.
|
|
@@ -71,19 +71,17 @@ const resolveOperationChannel = (document, operation) => {
|
|
|
71
71
|
* Resolves which channel message names an operation references.
|
|
72
72
|
*
|
|
73
73
|
* - `operation.messages === undefined` → every channel message is included.
|
|
74
|
-
* - `operation.messages === []` →
|
|
75
|
-
* - Otherwise → the channel messages that the operation explicitly references.
|
|
74
|
+
* - `operation.messages === []` → only reply messages on the same channel are included.
|
|
75
|
+
* - Otherwise → the channel messages that the operation or its reply explicitly references.
|
|
76
76
|
*/
|
|
77
77
|
const resolveOperationMessageNames = (operation, channel, channelName) => {
|
|
78
78
|
const channelMessages = channel.messages ?? {};
|
|
79
79
|
if (operation.messages === undefined) {
|
|
80
80
|
return objectKeys(channelMessages);
|
|
81
81
|
}
|
|
82
|
-
if (operation.messages.length === 0) {
|
|
83
|
-
return [];
|
|
84
|
-
}
|
|
85
82
|
const names = new Set();
|
|
86
|
-
|
|
83
|
+
const replyMessages = getResolvedAsyncApiRef(operation.reply)?.messages ?? [];
|
|
84
|
+
for (const messageRef of [...operation.messages, ...replyMessages]) {
|
|
87
85
|
if (!('$ref' in messageRef)) {
|
|
88
86
|
continue;
|
|
89
87
|
}
|
|
@@ -137,13 +135,9 @@ const sortOperations = (entries, operationsSorter) => {
|
|
|
137
135
|
entries.sort((a, b) => operationsSorter({ method: a.action, path: a.operationName, ref: a.operationName, httpVerb: a.action }, { method: b.action, path: b.operationName, ref: b.operationName, httpVerb: b.action }));
|
|
138
136
|
}
|
|
139
137
|
};
|
|
140
|
-
/** Sorts message navigation entries alphabetically by display title. */
|
|
141
|
-
const sortMessages = (entries) => {
|
|
142
|
-
entries.sort((a, b) => a.title.localeCompare(b.title));
|
|
143
|
-
};
|
|
144
138
|
/**
|
|
145
139
|
* Builds message entries beneath a channel or operation.
|
|
146
|
-
* Resolves each message ref
|
|
140
|
+
* Resolves each message ref and skips hidden messages while preserving the declared order.
|
|
147
141
|
*/
|
|
148
142
|
const createMessageEntries = ({ channelName, channel, parentId, messageNames, generateId, }) => {
|
|
149
143
|
const messages = messageNames.flatMap((messageName) => {
|
|
@@ -170,7 +164,6 @@ const createMessageEntries = ({ channelName, channel, parentId, messageNames, ge
|
|
|
170
164
|
},
|
|
171
165
|
];
|
|
172
166
|
});
|
|
173
|
-
sortMessages(messages);
|
|
174
167
|
return messages;
|
|
175
168
|
};
|
|
176
169
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AsyncApiInfoObject } from '@scalar/types/asyncapi/3.1';
|
|
2
|
-
import type { TraverseSpecOptions } from '
|
|
2
|
+
import type { TraverseSpecOptions } from '../types.js';
|
|
3
3
|
import type { TraversedDescription } from '../../schemas/navigation.js';
|
|
4
4
|
import type { InfoObject } from '../../schemas/v3.2/strict/info.js';
|
|
5
5
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type NavigationOptions } from '
|
|
1
|
+
import { type NavigationOptions } from '../get-navigation-options.js';
|
|
2
2
|
import type { TraversedEntry } from '../../schemas/navigation.js';
|
|
3
3
|
import type { OpenApiDocument } from '../../schemas/v3.2/strict/openapi-document.js';
|
|
4
4
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { unpackProxyObject } from '../../helpers/unpack-proxy.js';
|
|
2
|
-
import { getNavigationOptions } from '
|
|
2
|
+
import { getNavigationOptions } from '../get-navigation-options.js';
|
|
3
3
|
import { traverseDescription } from './traverse-description.js';
|
|
4
4
|
import { traversePaths } from './traverse-paths.js';
|
|
5
5
|
import { traverseSchemas } from './traverse-schemas.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { OperationTitleSource, TagsMap, TraverseSpecOptions } from '
|
|
1
|
+
import type { OperationTitleSource, TagsMap, TraverseSpecOptions } from '../types.js';
|
|
2
2
|
import type { TraversedOperation } from '../../schemas/navigation.js';
|
|
3
3
|
import type { OpenApiDocument, OperationObject } from '../../schemas/v3.2/strict/openapi-document.js';
|
|
4
4
|
export declare const isDeprecatedOperation: (operation: OperationObject) => boolean;
|