@redocly/api-docs 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +1 -0
- package/README.md +3 -0
- package/lib/.tsbuildinfo +1 -0
- package/lib/RedoclyApiDocs.d.ts +22 -0
- package/lib/RedoclyApiDocs.js +1 -0
- package/lib/RedoclyApiDocsStandalone.d.ts +18 -0
- package/lib/RedoclyApiDocsStandalone.js +26 -0
- package/lib/adapters/asyncapi/build/context.d.ts +10 -0
- package/lib/adapters/asyncapi/build/context.js +1 -0
- package/lib/adapters/asyncapi/build/navigation.d.ts +2 -0
- package/lib/adapters/asyncapi/build/navigation.js +1 -0
- package/lib/adapters/asyncapi/build/utils.d.ts +3 -0
- package/lib/adapters/asyncapi/build/utils.js +1 -0
- package/lib/adapters/asyncapi/buildContext.d.ts +2 -0
- package/lib/adapters/asyncapi/buildContext.js +1 -0
- package/lib/adapters/asyncapi/index.d.ts +14 -0
- package/lib/adapters/asyncapi/index.js +1 -0
- package/lib/adapters/asyncapi/items/channel/content.d.ts +5 -0
- package/lib/adapters/asyncapi/items/channel/content.js +1 -0
- package/lib/adapters/asyncapi/items/channel/item.d.ts +13 -0
- package/lib/adapters/asyncapi/items/channel/item.js +1 -0
- package/lib/adapters/asyncapi/items/operation/content.d.ts +4 -0
- package/lib/adapters/asyncapi/items/operation/content.js +3 -0
- package/lib/adapters/asyncapi/items/operation/item.d.ts +15 -0
- package/lib/adapters/asyncapi/items/operation/item.js +1 -0
- package/lib/adapters/asyncapi/items/overview/content.d.ts +10 -0
- package/lib/adapters/asyncapi/items/overview/content.js +1 -0
- package/lib/adapters/asyncapi/items/overview/item.d.ts +16 -0
- package/lib/adapters/asyncapi/items/overview/item.js +1 -0
- package/lib/adapters/asyncapi/panels/brokers.d.ts +4 -0
- package/lib/adapters/asyncapi/panels/brokers.js +1 -0
- package/lib/adapters/asyncapi/panels/download.d.ts +3 -0
- package/lib/adapters/asyncapi/panels/download.js +1 -0
- package/lib/adapters/asyncapi/panels/group.d.ts +16 -0
- package/lib/adapters/asyncapi/panels/group.js +1 -0
- package/lib/adapters/asyncapi/panels/overview.d.ts +3 -0
- package/lib/adapters/asyncapi/panels/overview.js +1 -0
- package/lib/adapters/asyncapi/store.d.ts +4 -0
- package/lib/adapters/asyncapi/store.js +1 -0
- package/lib/adapters/asyncapi/utils/avro-to-json-schema.d.ts +4 -0
- package/lib/adapters/asyncapi/utils/avro-to-json-schema.js +1 -0
- package/lib/adapters/asyncapi/utils/get-channel-label.d.ts +3 -0
- package/lib/adapters/asyncapi/utils/get-channel-label.js +1 -0
- package/lib/adapters/asyncapi/utils/get-protocol-labels.d.ts +24 -0
- package/lib/adapters/asyncapi/utils/get-protocol-labels.js +1 -0
- package/lib/adapters/asyncapi/utils/get-server-host.d.ts +3 -0
- package/lib/adapters/asyncapi/utils/get-server-host.js +1 -0
- package/lib/adapters/asyncapi/utils/resolve-schema.d.ts +2 -0
- package/lib/adapters/asyncapi/utils/resolve-schema.js +1 -0
- package/lib/adapters/asyncapi/utils/resolveInDoc.d.ts +2 -0
- package/lib/adapters/asyncapi/utils/resolveInDoc.js +1 -0
- package/lib/adapters/build.d.ts +31 -0
- package/lib/adapters/build.js +1 -0
- package/lib/adapters/graphql/build/context.d.ts +9 -0
- package/lib/adapters/graphql/build/context.js +1 -0
- package/lib/adapters/graphql/buildContext.d.ts +2 -0
- package/lib/adapters/graphql/buildContext.js +1 -0
- package/lib/adapters/graphql/buildStoreFromSdl.d.ts +2 -0
- package/lib/adapters/graphql/buildStoreFromSdl.js +1 -0
- package/lib/adapters/graphql/group/custom.d.ts +2 -0
- package/lib/adapters/graphql/group/custom.js +1 -0
- package/lib/adapters/graphql/group/default.d.ts +2 -0
- package/lib/adapters/graphql/group/default.js +1 -0
- package/lib/adapters/graphql/group/errors.d.ts +1 -0
- package/lib/adapters/graphql/group/errors.js +1 -0
- package/lib/adapters/graphql/group/itemBuilders.d.ts +5 -0
- package/lib/adapters/graphql/group/itemBuilders.js +1 -0
- package/lib/adapters/graphql/group/utils.d.ts +8 -0
- package/lib/adapters/graphql/group/utils.js +1 -0
- package/lib/adapters/graphql/index.d.ts +10 -0
- package/lib/adapters/graphql/index.js +1 -0
- package/lib/adapters/graphql/items/directive/content.d.ts +4 -0
- package/lib/adapters/graphql/items/directive/content.js +1 -0
- package/lib/adapters/graphql/items/directive/item.d.ts +3 -0
- package/lib/adapters/graphql/items/directive/item.js +1 -0
- package/lib/adapters/graphql/items/enum/content.d.ts +4 -0
- package/lib/adapters/graphql/items/enum/content.js +1 -0
- package/lib/adapters/graphql/items/enum/item.d.ts +3 -0
- package/lib/adapters/graphql/items/enum/item.js +1 -0
- package/lib/adapters/graphql/items/input/content.d.ts +4 -0
- package/lib/adapters/graphql/items/input/content.js +1 -0
- package/lib/adapters/graphql/items/input/item.d.ts +3 -0
- package/lib/adapters/graphql/items/input/item.js +1 -0
- package/lib/adapters/graphql/items/interface/content.d.ts +4 -0
- package/lib/adapters/graphql/items/interface/content.js +1 -0
- package/lib/adapters/graphql/items/interface/item.d.ts +3 -0
- package/lib/adapters/graphql/items/interface/item.js +1 -0
- package/lib/adapters/graphql/items/mutation/content.d.ts +4 -0
- package/lib/adapters/graphql/items/mutation/content.js +1 -0
- package/lib/adapters/graphql/items/mutation/item.d.ts +3 -0
- package/lib/adapters/graphql/items/mutation/item.js +1 -0
- package/lib/adapters/graphql/items/object/content.d.ts +4 -0
- package/lib/adapters/graphql/items/object/content.js +1 -0
- package/lib/adapters/graphql/items/object/item.d.ts +3 -0
- package/lib/adapters/graphql/items/object/item.js +1 -0
- package/lib/adapters/graphql/items/operation/content.d.ts +7 -0
- package/lib/adapters/graphql/items/operation/content.js +1 -0
- package/lib/adapters/graphql/items/overview/content.d.ts +11 -0
- package/lib/adapters/graphql/items/overview/content.js +1 -0
- package/lib/adapters/graphql/items/overview/item.d.ts +4 -0
- package/lib/adapters/graphql/items/overview/item.js +1 -0
- package/lib/adapters/graphql/items/query/content.d.ts +4 -0
- package/lib/adapters/graphql/items/query/content.js +1 -0
- package/lib/adapters/graphql/items/query/item.d.ts +3 -0
- package/lib/adapters/graphql/items/query/item.js +1 -0
- package/lib/adapters/graphql/items/scalar/content.d.ts +4 -0
- package/lib/adapters/graphql/items/scalar/content.js +1 -0
- package/lib/adapters/graphql/items/scalar/item.d.ts +3 -0
- package/lib/adapters/graphql/items/scalar/item.js +1 -0
- package/lib/adapters/graphql/items/subscription/content.d.ts +4 -0
- package/lib/adapters/graphql/items/subscription/content.js +1 -0
- package/lib/adapters/graphql/items/subscription/item.d.ts +3 -0
- package/lib/adapters/graphql/items/subscription/item.js +1 -0
- package/lib/adapters/graphql/items/types.d.ts +7 -0
- package/lib/adapters/graphql/items/types.js +0 -0
- package/lib/adapters/graphql/items/union/content.d.ts +4 -0
- package/lib/adapters/graphql/items/union/content.js +1 -0
- package/lib/adapters/graphql/items/union/item.d.ts +3 -0
- package/lib/adapters/graphql/items/union/item.js +1 -0
- package/lib/adapters/graphql/panels/download.d.ts +3 -0
- package/lib/adapters/graphql/panels/download.js +1 -0
- package/lib/adapters/graphql/panels/group-items.d.ts +4 -0
- package/lib/adapters/graphql/panels/group-items.js +1 -0
- package/lib/adapters/graphql/panels/overview.d.ts +3 -0
- package/lib/adapters/graphql/panels/overview.js +1 -0
- package/lib/adapters/graphql/serializeType.d.ts +5 -0
- package/lib/adapters/graphql/serializeType.js +1 -0
- package/lib/adapters/graphql/store.d.ts +3 -0
- package/lib/adapters/graphql/store.js +1 -0
- package/lib/adapters/graphql/utils/appendGraphqlItemFeedback.d.ts +2 -0
- package/lib/adapters/graphql/utils/appendGraphqlItemFeedback.js +1 -0
- package/lib/adapters/graphql/utils/configMetadataRows.d.ts +3 -0
- package/lib/adapters/graphql/utils/configMetadataRows.js +1 -0
- package/lib/adapters/graphql/utils/constants.d.ts +23 -0
- package/lib/adapters/graphql/utils/constants.js +1 -0
- package/lib/adapters/graphql/utils/createApiItem.d.ts +15 -0
- package/lib/adapters/graphql/utils/createApiItem.js +1 -0
- package/lib/adapters/graphql/utils/getBadges.d.ts +4 -0
- package/lib/adapters/graphql/utils/getBadges.js +1 -0
- package/lib/adapters/graphql/utils/ignoreInternalItems.d.ts +3 -0
- package/lib/adapters/graphql/utils/ignoreInternalItems.js +1 -0
- package/lib/adapters/graphql/utils/isRootType.d.ts +2 -0
- package/lib/adapters/graphql/utils/isRootType.js +1 -0
- package/lib/adapters/graphql/utils/menuSlashRegex.d.ts +1 -0
- package/lib/adapters/graphql/utils/menuSlashRegex.js +1 -0
- package/lib/adapters/graphql/utils/normalizeMenu.d.ts +3 -0
- package/lib/adapters/graphql/utils/normalizeMenu.js +1 -0
- package/lib/adapters/graphql/utils/shouldIncludeItem.d.ts +2 -0
- package/lib/adapters/graphql/utils/shouldIncludeItem.js +1 -0
- package/lib/adapters/graphql/utils/summary.d.ts +4 -0
- package/lib/adapters/graphql/utils/summary.js +1 -0
- package/lib/adapters/graphql/utils/validateMenuConfig.d.ts +3 -0
- package/lib/adapters/graphql/utils/validateMenuConfig.js +1 -0
- package/lib/adapters/helpers.d.ts +47 -0
- package/lib/adapters/helpers.js +1 -0
- package/lib/adapters/openapi/build/context.d.ts +13 -0
- package/lib/adapters/openapi/build/context.js +1 -0
- package/lib/adapters/openapi/build-code-sample-source.d.ts +5 -0
- package/lib/adapters/openapi/build-code-sample-source.js +1 -0
- package/lib/adapters/openapi/buildContext.d.ts +2 -0
- package/lib/adapters/openapi/buildContext.js +1 -0
- package/lib/adapters/openapi/configure/apply-request-values.d.ts +3 -0
- package/lib/adapters/openapi/configure/apply-request-values.js +1 -0
- package/lib/adapters/openapi/configure/index.d.ts +3 -0
- package/lib/adapters/openapi/configure/index.js +1 -0
- package/lib/adapters/openapi/configure/merge-utils.d.ts +32 -0
- package/lib/adapters/openapi/configure/merge-utils.js +1 -0
- package/lib/adapters/openapi/configure/resolve-request-values.d.ts +17 -0
- package/lib/adapters/openapi/configure/resolve-request-values.js +1 -0
- package/lib/adapters/openapi/constants.d.ts +4 -0
- package/lib/adapters/openapi/constants.js +1 -0
- package/lib/adapters/openapi/group/content.d.ts +28 -0
- package/lib/adapters/openapi/group/content.js +1 -0
- package/lib/adapters/openapi/group/item.d.ts +11 -0
- package/lib/adapters/openapi/group/item.js +1 -0
- package/lib/adapters/openapi/index.d.ts +13 -0
- package/lib/adapters/openapi/index.js +1 -0
- package/lib/adapters/openapi/items/mcp/content.d.ts +5 -0
- package/lib/adapters/openapi/items/mcp/content.js +1 -0
- package/lib/adapters/openapi/items/mcp/item.d.ts +9 -0
- package/lib/adapters/openapi/items/mcp/item.js +1 -0
- package/lib/adapters/openapi/items/operation/content.d.ts +3 -0
- package/lib/adapters/openapi/items/operation/content.js +1 -0
- package/lib/adapters/openapi/items/operation/item.d.ts +9 -0
- package/lib/adapters/openapi/items/operation/item.js +1 -0
- package/lib/adapters/openapi/items/overview/content.d.ts +18 -0
- package/lib/adapters/openapi/items/overview/content.js +1 -0
- package/lib/adapters/openapi/items/overview/item.d.ts +3 -0
- package/lib/adapters/openapi/items/overview/item.js +1 -0
- package/lib/adapters/openapi/items/schema/content.d.ts +3 -0
- package/lib/adapters/openapi/items/schema/content.js +1 -0
- package/lib/adapters/openapi/items/schema/item.d.ts +9 -0
- package/lib/adapters/openapi/items/schema/item.js +1 -0
- package/lib/adapters/openapi/panels/download.d.ts +3 -0
- package/lib/adapters/openapi/panels/download.js +1 -0
- package/lib/adapters/openapi/panels/languages.d.ts +3 -0
- package/lib/adapters/openapi/panels/languages.js +1 -0
- package/lib/adapters/openapi/panels/mcp.d.ts +3 -0
- package/lib/adapters/openapi/panels/mcp.js +1 -0
- package/lib/adapters/openapi/panels/overview.d.ts +3 -0
- package/lib/adapters/openapi/panels/overview.js +1 -0
- package/lib/adapters/openapi/panels/servers.d.ts +3 -0
- package/lib/adapters/openapi/panels/servers.js +1 -0
- package/lib/adapters/openapi/resolve-openapi-example-value.d.ts +3 -0
- package/lib/adapters/openapi/resolve-openapi-example-value.js +1 -0
- package/lib/adapters/openapi/store.d.ts +4 -0
- package/lib/adapters/openapi/store.js +1 -0
- package/lib/adapters/openapi/utils/JsonPointer.d.ts +51 -0
- package/lib/adapters/openapi/utils/JsonPointer.js +1 -0
- package/lib/adapters/openapi/utils/applyIgnoreNamedSchemasDeep.d.ts +1 -0
- package/lib/adapters/openapi/utils/applyIgnoreNamedSchemasDeep.js +1 -0
- package/lib/adapters/openapi/utils/helpers.d.ts +14 -0
- package/lib/adapters/openapi/utils/helpers.js +1 -0
- package/lib/adapters/openapi/utils/merge-mock-server.d.ts +15 -0
- package/lib/adapters/openapi/utils/merge-mock-server.js +1 -0
- package/lib/adapters/openapi/utils/operation.d.ts +23 -0
- package/lib/adapters/openapi/utils/operation.js +1 -0
- package/lib/adapters/openapi/utils/resolvePathItemRef.d.ts +2 -0
- package/lib/adapters/openapi/utils/resolvePathItemRef.js +1 -0
- package/lib/adapters/openapi/utils/url.d.ts +2 -0
- package/lib/adapters/openapi/utils/url.js +1 -0
- package/lib/adapters/rbac-schema-propagation.d.ts +2 -0
- package/lib/adapters/rbac-schema-propagation.js +1 -0
- package/lib/adapters/scopedContext.d.ts +5 -0
- package/lib/adapters/scopedContext.js +1 -0
- package/lib/adapters/utils/convertSwagger2OpenAPI.d.ts +2 -0
- package/lib/adapters/utils/convertSwagger2OpenAPI.js +1 -0
- package/lib/adapters/utils/dompurify.d.ts +5 -0
- package/lib/adapters/utils/dompurify.js +1 -0
- package/lib/adapters/utils/infoMetadata.d.ts +5 -0
- package/lib/adapters/utils/infoMetadata.js +1 -0
- package/lib/adapters/utils/isPlainText.d.ts +6 -0
- package/lib/adapters/utils/isPlainText.js +1 -0
- package/lib/adapters/utils/markdoc.d.ts +38 -0
- package/lib/adapters/utils/markdoc.js +1 -0
- package/lib/adapters/utils/parseMarkdown.d.ts +8 -0
- package/lib/adapters/utils/parseMarkdown.js +1 -0
- package/lib/adapters/utils/seo.d.ts +3 -0
- package/lib/adapters/utils/seo.js +1 -0
- package/lib/adapters/utils/simplifyAstStructure.d.ts +2 -0
- package/lib/adapters/utils/simplifyAstStructure.js +1 -0
- package/lib/components/AdmonitionItem.d.ts +6 -0
- package/lib/components/AdmonitionItem.js +1 -0
- package/lib/components/ChannelAddressItem.d.ts +7 -0
- package/lib/components/ChannelAddressItem.js +31 -0
- package/lib/components/ContainerItem.d.ts +9 -0
- package/lib/components/ContainerItem.js +1 -0
- package/lib/components/EmptyMessageItem.d.ts +6 -0
- package/lib/components/EmptyMessageItem.js +6 -0
- package/lib/components/ErrorBoundary.d.ts +18 -0
- package/lib/components/ErrorBoundary.js +1 -0
- package/lib/components/ExtensionsItem.d.ts +7 -0
- package/lib/components/ExtensionsItem.js +1 -0
- package/lib/components/ExternalDocsItem.d.ts +8 -0
- package/lib/components/ExternalDocsItem.js +1 -0
- package/lib/components/FeedbackItem.d.ts +9 -0
- package/lib/components/FeedbackItem.js +17 -0
- package/lib/components/Header/HeaderItem.d.ts +91 -0
- package/lib/components/Header/HeaderItem.js +105 -0
- package/lib/components/Header/HeaderResponseCodeTabs.d.ts +8 -0
- package/lib/components/Header/HeaderResponseCodeTabs.js +1 -0
- package/lib/components/Header/ResponseDeepLinkAnchor.d.ts +9 -0
- package/lib/components/Header/ResponseDeepLinkAnchor.js +1 -0
- package/lib/components/Header/hooks.d.ts +5 -0
- package/lib/components/Header/hooks.js +1 -0
- package/lib/components/InfoMetadataItem.d.ts +7 -0
- package/lib/components/InfoMetadataItem.js +1 -0
- package/lib/components/ItemContent/ItemContentRenderer.d.ts +8 -0
- package/lib/components/ItemContent/ItemContentRenderer.js +11 -0
- package/lib/components/ItemContent/SectionHeader.d.ts +8 -0
- package/lib/components/ItemContent/SectionHeader.js +14 -0
- package/lib/components/ItemContent/hooks.d.ts +5 -0
- package/lib/components/ItemContent/hooks.js +1 -0
- package/lib/components/ItemContent/sections/BodyMimeTypeField.d.ts +12 -0
- package/lib/components/ItemContent/sections/BodyMimeTypeField.js +60 -0
- package/lib/components/ItemContent/sections/BodySection.d.ts +7 -0
- package/lib/components/ItemContent/sections/BodySection.js +13 -0
- package/lib/components/ItemContent/sections/CallbacksSection.d.ts +5 -0
- package/lib/components/ItemContent/sections/CallbacksSection.js +131 -0
- package/lib/components/ItemContent/sections/FieldsSection.d.ts +7 -0
- package/lib/components/ItemContent/sections/FieldsSection.js +79 -0
- package/lib/components/ItemContent/sections/MessagesSection.d.ts +5 -0
- package/lib/components/ItemContent/sections/MessagesSection.js +58 -0
- package/lib/components/ItemContent/sections/ParametersSection.d.ts +6 -0
- package/lib/components/ItemContent/sections/ParametersSection.js +4 -0
- package/lib/components/ItemContent/sections/ResponsesSection.d.ts +5 -0
- package/lib/components/ItemContent/sections/ResponsesSection.js +28 -0
- package/lib/components/ItemContent/sections/ValuesSection.d.ts +5 -0
- package/lib/components/ItemContent/sections/ValuesSection.js +26 -0
- package/lib/components/LicenseOverlay.d.ts +6 -0
- package/lib/components/LicenseOverlay.js +42 -0
- package/lib/components/Mapper.d.ts +25 -0
- package/lib/components/Mapper.js +1 -0
- package/lib/components/MarkdownItem.d.ts +6 -0
- package/lib/components/MarkdownItem.js +1 -0
- package/lib/components/Mcp/McpPrompt.d.ts +8 -0
- package/lib/components/Mcp/McpPrompt.js +1 -0
- package/lib/components/Mcp/McpResource.d.ts +8 -0
- package/lib/components/Mcp/McpResource.js +3 -0
- package/lib/components/Mcp/McpTool.d.ts +8 -0
- package/lib/components/Mcp/McpTool.js +1 -0
- package/lib/components/Mcp/styled.d.ts +19 -0
- package/lib/components/Mcp/styled.js +22 -0
- package/lib/components/Mcp/utils.d.ts +6 -0
- package/lib/components/Mcp/utils.js +1 -0
- package/lib/components/MessageLinksItem.d.ts +7 -0
- package/lib/components/MessageLinksItem.js +30 -0
- package/lib/components/RenderHook.d.ts +6 -0
- package/lib/components/RenderHook.js +1 -0
- package/lib/components/Replay/EmbeddedReplay.d.ts +16 -0
- package/lib/components/Replay/EmbeddedReplay.js +10 -0
- package/lib/components/Replay/Replay.d.ts +13 -0
- package/lib/components/Replay/Replay.js +1 -0
- package/lib/components/Replay/adapterToMarkdownParser.d.ts +12 -0
- package/lib/components/Replay/adapterToMarkdownParser.js +1 -0
- package/lib/components/Replay/index.d.ts +2 -0
- package/lib/components/Replay/index.js +1 -0
- package/lib/components/Schema/SchemaDescription.d.ts +5 -0
- package/lib/components/Schema/SchemaDescription.js +1 -0
- package/lib/components/Schema/SchemaView.d.ts +20 -0
- package/lib/components/Schema/SchemaView.js +1 -0
- package/lib/components/Schema/helpers.d.ts +1 -0
- package/lib/components/Schema/helpers.js +1 -0
- package/lib/components/Schema/hooks/useSchemaDocument.d.ts +7 -0
- package/lib/components/Schema/hooks/useSchemaDocument.js +1 -0
- package/lib/components/Schema/hooks/useSchemaFieldDeepLink.d.ts +5 -0
- package/lib/components/Schema/hooks/useSchemaFieldDeepLink.js +1 -0
- package/lib/components/Schema/hooks/useVariantIndexFromHash.d.ts +1 -0
- package/lib/components/Schema/hooks/useVariantIndexFromHash.js +1 -0
- package/lib/components/Schema/styled.d.ts +146 -0
- package/lib/components/Schema/styled.js +342 -0
- package/lib/components/Schema/utils.d.ts +26 -0
- package/lib/components/Schema/utils.js +1 -0
- package/lib/components/Schema/views/ArrayRenderer.d.ts +13 -0
- package/lib/components/Schema/views/ArrayRenderer.js +1 -0
- package/lib/components/Schema/views/CollapsibleNestedFields.d.ts +25 -0
- package/lib/components/Schema/views/CollapsibleNestedFields.js +1 -0
- package/lib/components/Schema/views/DefaultMappingOptionLabel.d.ts +5 -0
- package/lib/components/Schema/views/DefaultMappingOptionLabel.js +15 -0
- package/lib/components/Schema/views/DiscriminatorPropertyRow.d.ts +13 -0
- package/lib/components/Schema/views/DiscriminatorPropertyRow.js +1 -0
- package/lib/components/Schema/views/Examples.d.ts +7 -0
- package/lib/components/Schema/views/Examples.js +1 -0
- package/lib/components/Schema/views/ExpandableExample.d.ts +4 -0
- package/lib/components/Schema/views/ExpandableExample.js +3 -0
- package/lib/components/Schema/views/ObjectRenderer.d.ts +14 -0
- package/lib/components/Schema/views/ObjectRenderer.js +1 -0
- package/lib/components/Schema/views/Pattern.d.ts +6 -0
- package/lib/components/Schema/views/Pattern.js +1 -0
- package/lib/components/Schema/views/PrimitiveRenderer.d.ts +5 -0
- package/lib/components/Schema/views/PrimitiveRenderer.js +1 -0
- package/lib/components/Schema/views/PropertyFieldRow.d.ts +16 -0
- package/lib/components/Schema/views/PropertyFieldRow.js +1 -0
- package/lib/components/Schema/views/PropertyRenderer.d.ts +15 -0
- package/lib/components/Schema/views/PropertyRenderer.js +1 -0
- package/lib/components/Schema/views/SchemaEnumDescriptions.d.ts +9 -0
- package/lib/components/Schema/views/SchemaEnumDescriptions.js +5 -0
- package/lib/components/Schema/views/SchemaEnumValues.d.ts +8 -0
- package/lib/components/Schema/views/SchemaEnumValues.js +1 -0
- package/lib/components/Schema/views/SchemaTitleLabel.d.ts +5 -0
- package/lib/components/Schema/views/SchemaTitleLabel.js +1 -0
- package/lib/components/Schema/views/SchemaVariantSelector.d.ts +11 -0
- package/lib/components/Schema/views/SchemaVariantSelector.js +1 -0
- package/lib/components/Schema/views/SwitcherRenderer.d.ts +14 -0
- package/lib/components/Schema/views/SwitcherRenderer.js +1 -0
- package/lib/components/Schema/views/VariantDropdown.d.ts +14 -0
- package/lib/components/Schema/views/VariantDropdown.js +99 -0
- package/lib/components/SchemaCatalogLink.d.ts +6 -0
- package/lib/components/SchemaCatalogLink.js +35 -0
- package/lib/components/Security/Divider.d.ts +4 -0
- package/lib/components/Security/Divider.js +15 -0
- package/lib/components/Security/RequiredScopes.d.ts +4 -0
- package/lib/components/Security/RequiredScopes.js +5 -0
- package/lib/components/Security/ScopeTagWithTooltip.d.ts +11 -0
- package/lib/components/Security/ScopeTagWithTooltip.js +28 -0
- package/lib/components/Security/SecurityButtonPanel.d.ts +5 -0
- package/lib/components/Security/SecurityButtonPanel.js +1 -0
- package/lib/components/Security/SecurityFlowDetail.d.ts +5 -0
- package/lib/components/Security/SecurityFlowDetail.js +1 -0
- package/lib/components/Security/SecurityModal.d.ts +6 -0
- package/lib/components/Security/SecurityModal.js +1 -0
- package/lib/components/Security/SecuritySection.d.ts +3 -0
- package/lib/components/Security/SecuritySection.js +1 -0
- package/lib/components/Security/styled.d.ts +83 -0
- package/lib/components/Security/styled.js +219 -0
- package/lib/components/Security/types.d.ts +3 -0
- package/lib/components/Security/types.js +0 -0
- package/lib/components/SideMenu/SideMenu.d.ts +7 -0
- package/lib/components/SideMenu/SideMenu.js +4 -0
- package/lib/components/SideMenu/buildMenuItems.d.ts +29 -0
- package/lib/components/SideMenu/buildMenuItems.js +1 -0
- package/lib/components/SideMenu/useMenuItems.d.ts +14 -0
- package/lib/components/SideMenu/useMenuItems.js +1 -0
- package/lib/components/StickySidebar/SidebarActions.d.ts +1 -0
- package/lib/components/StickySidebar/SidebarActions.js +5 -0
- package/lib/components/StickySidebar/StickySidebar.d.ts +7 -0
- package/lib/components/StickySidebar/StickySidebar.js +22 -0
- package/lib/components/common/Badge.d.ts +43 -0
- package/lib/components/common/Badge.js +33 -0
- package/lib/components/common/Breadcrumbs.d.ts +11 -0
- package/lib/components/common/Breadcrumbs.js +43 -0
- package/lib/components/common/ContentWrapper.d.ts +25 -0
- package/lib/components/common/ContentWrapper.js +106 -0
- package/lib/components/common/DeepLinkAnchor.d.ts +20 -0
- package/lib/components/common/DeepLinkAnchor.js +32 -0
- package/lib/components/common/ExpandAllButton.d.ts +6 -0
- package/lib/components/common/ExpandAllButton.js +3 -0
- package/lib/components/common/ExternalDocumentation.d.ts +10 -0
- package/lib/components/common/ExternalDocumentation.js +10 -0
- package/lib/components/common/LazyMount.d.ts +9 -0
- package/lib/components/common/LazyMount.js +3 -0
- package/lib/components/common/LazySection.d.ts +14 -0
- package/lib/components/common/LazySection.js +9 -0
- package/lib/components/common/Markdown.d.ts +7 -0
- package/lib/components/common/Markdown.js +1 -0
- package/lib/components/common/MoreDetailsButton.d.ts +5 -0
- package/lib/components/common/MoreDetailsButton.js +12 -0
- package/lib/components/common/NestedToggleButton.d.ts +10 -0
- package/lib/components/common/NestedToggleButton.js +16 -0
- package/lib/components/common/PanelItem.d.ts +70 -0
- package/lib/components/common/PanelItem.js +62 -0
- package/lib/components/common/ResponseCodeTabs.d.ts +8 -0
- package/lib/components/common/ResponseCodeTabs.js +36 -0
- package/lib/components/common/Tag.d.ts +1 -0
- package/lib/components/common/Tag.js +11 -0
- package/lib/components/common/VendorExtensions.d.ts +7 -0
- package/lib/components/common/VendorExtensions.js +5 -0
- package/lib/components/common/ViewNested.d.ts +14 -0
- package/lib/components/common/ViewNested.js +31 -0
- package/lib/components/graphql/ArrowIcon.d.ts +9 -0
- package/lib/components/graphql/ArrowIcon.js +4 -0
- package/lib/components/graphql/GraphQLArgumentsSection.d.ts +10 -0
- package/lib/components/graphql/GraphQLArgumentsSection.js +1 -0
- package/lib/components/graphql/GraphQLEnumEmbedded.d.ts +5 -0
- package/lib/components/graphql/GraphQLEnumEmbedded.js +3 -0
- package/lib/components/graphql/GraphQLFieldView.d.ts +12 -0
- package/lib/components/graphql/GraphQLFieldView.js +1 -0
- package/lib/components/graphql/GraphQLFieldsEmbedded.d.ts +9 -0
- package/lib/components/graphql/GraphQLFieldsEmbedded.js +1 -0
- package/lib/components/graphql/GraphQLGroupTypeList.d.ts +5 -0
- package/lib/components/graphql/GraphQLGroupTypeList.js +11 -0
- package/lib/components/graphql/GraphQLHeaderExtras.d.ts +7 -0
- package/lib/components/graphql/GraphQLHeaderExtras.js +1 -0
- package/lib/components/graphql/GraphQLReturnTypeDetails.d.ts +11 -0
- package/lib/components/graphql/GraphQLReturnTypeDetails.js +18 -0
- package/lib/components/graphql/GraphQLTypeView.d.ts +9 -0
- package/lib/components/graphql/GraphQLTypeView.js +1 -0
- package/lib/components/graphql/GraphQLUnionEmbedded.d.ts +5 -0
- package/lib/components/graphql/GraphQLUnionEmbedded.js +1 -0
- package/lib/components/graphql/RequiresScopesButton.d.ts +9 -0
- package/lib/components/graphql/RequiresScopesButton.js +38 -0
- package/lib/components/graphql/RequiresScopesModal.d.ts +9 -0
- package/lib/components/graphql/RequiresScopesModal.js +88 -0
- package/lib/components/graphql/ViewNested.d.ts +14 -0
- package/lib/components/graphql/ViewNested.js +46 -0
- package/lib/components/graphql/renderDescription.d.ts +2 -0
- package/lib/components/graphql/renderDescription.js +1 -0
- package/lib/components/graphql/sections/GraphQLArgsSection.d.ts +5 -0
- package/lib/components/graphql/sections/GraphQLArgsSection.js +7 -0
- package/lib/components/graphql/sections/GraphQLFieldsSection.d.ts +5 -0
- package/lib/components/graphql/sections/GraphQLFieldsSection.js +1 -0
- package/lib/components/graphql/sections/ImplementedBySection.d.ts +5 -0
- package/lib/components/graphql/sections/ImplementedBySection.js +1 -0
- package/lib/components/graphql/sections/ImplementsSection.d.ts +5 -0
- package/lib/components/graphql/sections/ImplementsSection.js +1 -0
- package/lib/components/graphql/sections/PossibleTypesSection.d.ts +5 -0
- package/lib/components/graphql/sections/PossibleTypesSection.js +1 -0
- package/lib/components/graphql/sections/RequiresScopesSection.d.ts +5 -0
- package/lib/components/graphql/sections/RequiresScopesSection.js +1 -0
- package/lib/components/graphql/sections/ReturnTypeSection.d.ts +5 -0
- package/lib/components/graphql/sections/ReturnTypeSection.js +7 -0
- package/lib/components/graphql/styled.d.ts +45 -0
- package/lib/components/graphql/styled.js +124 -0
- package/lib/components/markdoc/Heading.d.ts +11 -0
- package/lib/components/markdoc/Heading.js +6 -0
- package/lib/components/markdoc/SchemaDefinition.d.ts +11 -0
- package/lib/components/markdoc/SchemaDefinition.js +6 -0
- package/lib/components/markdoc/apiDocsMarkdocComponents.d.ts +6 -0
- package/lib/components/markdoc/apiDocsMarkdocComponents.js +1 -0
- package/lib/components/markdoc/buildMarkdocOptions.d.ts +9 -0
- package/lib/components/markdoc/buildMarkdocOptions.js +1 -0
- package/lib/components/markdoc/defaultMarkdocConfig.d.ts +14 -0
- package/lib/components/markdoc/defaultMarkdocConfig.js +1 -0
- package/lib/components/markdoc/markdocAdapter.d.ts +11 -0
- package/lib/components/markdoc/markdocAdapter.js +1 -0
- package/lib/components/markdoc/markdocParser.d.ts +6 -0
- package/lib/components/markdoc/markdocParser.js +1 -0
- package/lib/components/markdoc/markdocRenderer.d.ts +8 -0
- package/lib/components/markdoc/markdocRenderer.js +3 -0
- package/lib/components/markdoc/tags/mcp-tag-schemas.d.ts +2 -0
- package/lib/components/markdoc/tags/mcp-tag-schemas.js +1 -0
- package/lib/components/markdoc/tags/schema-definition-tag.d.ts +2 -0
- package/lib/components/markdoc/tags/schema-definition-tag.js +1 -0
- package/lib/components/panels/DownloadPanelItem.d.ts +5 -0
- package/lib/components/panels/DownloadPanelItem.js +26 -0
- package/lib/components/panels/ExampleItem/CallbackPayloadItem.d.ts +5 -0
- package/lib/components/panels/ExampleItem/CallbackPayloadItem.js +5 -0
- package/lib/components/panels/ExampleItem/CodeSampleItem.d.ts +5 -0
- package/lib/components/panels/ExampleItem/CodeSampleItem.js +1 -0
- package/lib/components/panels/ExampleItem/ExamplesPanelItem.d.ts +3 -0
- package/lib/components/panels/ExampleItem/ExamplesPanelItem.js +1 -0
- package/lib/components/panels/ExampleItem/GraphQLQueryItem.d.ts +5 -0
- package/lib/components/panels/ExampleItem/GraphQLQueryItem.js +1 -0
- package/lib/components/panels/ExampleItem/GraphQLResponseItem.d.ts +5 -0
- package/lib/components/panels/ExampleItem/GraphQLResponseItem.js +1 -0
- package/lib/components/panels/ExampleItem/GraphQLTypeSampleItem.d.ts +5 -0
- package/lib/components/panels/ExampleItem/GraphQLTypeSampleItem.js +1 -0
- package/lib/components/panels/ExampleItem/GraphQLVariablesItem.d.ts +5 -0
- package/lib/components/panels/ExampleItem/GraphQLVariablesItem.js +1 -0
- package/lib/components/panels/ExampleItem/PayloadExampleItem.d.ts +5 -0
- package/lib/components/panels/ExampleItem/PayloadExampleItem.js +4 -0
- package/lib/components/panels/ExampleItem/ResponseExampleItem.d.ts +5 -0
- package/lib/components/panels/ExampleItem/ResponseExampleItem.js +1 -0
- package/lib/components/panels/ExampleItem/ServerDropdown.d.ts +17 -0
- package/lib/components/panels/ExampleItem/ServerDropdown.js +11 -0
- package/lib/components/panels/ExampleItem/hooks.d.ts +25 -0
- package/lib/components/panels/ExampleItem/hooks.js +1 -0
- package/lib/components/panels/ExampleItem/selectors.d.ts +36 -0
- package/lib/components/panels/ExampleItem/selectors.js +1 -0
- package/lib/components/panels/ExampleItem/styled.d.ts +164 -0
- package/lib/components/panels/ExampleItem/styled.js +128 -0
- package/lib/components/panels/ExampleItem/types.d.ts +9 -0
- package/lib/components/panels/ExampleItem/types.js +0 -0
- package/lib/components/panels/GroupPanelItem.d.ts +5 -0
- package/lib/components/panels/GroupPanelItem.js +116 -0
- package/lib/components/panels/LanguageItem/LanguageDropdown.d.ts +15 -0
- package/lib/components/panels/LanguageItem/LanguageDropdown.js +1 -0
- package/lib/components/panels/LanguageItem/LanguageItem.d.ts +11 -0
- package/lib/components/panels/LanguageItem/LanguageItem.js +1 -0
- package/lib/components/panels/LanguageItem/LanguageList.d.ts +10 -0
- package/lib/components/panels/LanguageItem/LanguageList.js +1 -0
- package/lib/components/panels/LanguageItem/LanguageListSkeleton.d.ts +4 -0
- package/lib/components/panels/LanguageItem/LanguageListSkeleton.js +22 -0
- package/lib/components/panels/LanguageItem/LanguagePanelItem.d.ts +5 -0
- package/lib/components/panels/LanguageItem/LanguagePanelItem.js +1 -0
- package/lib/components/panels/LanguageItem/constants.d.ts +2 -0
- package/lib/components/panels/LanguageItem/constants.js +1 -0
- package/lib/components/panels/LanguageItem/styled.d.ts +94 -0
- package/lib/components/panels/LanguageItem/styled.js +96 -0
- package/lib/components/panels/LocationsPanelItem.d.ts +5 -0
- package/lib/components/panels/LocationsPanelItem.js +1 -0
- package/lib/components/panels/McpExamplePanelItem.d.ts +5 -0
- package/lib/components/panels/McpExamplePanelItem.js +6 -0
- package/lib/components/panels/McpPanelItem.d.ts +3 -0
- package/lib/components/panels/McpPanelItem.js +54 -0
- package/lib/components/panels/OverviewPanelItem.d.ts +3 -0
- package/lib/components/panels/OverviewPanelItem.js +17 -0
- package/lib/components/panels/PanelMapper.d.ts +5 -0
- package/lib/components/panels/PanelMapper.js +1 -0
- package/lib/components/panels/PanelNodeProps.d.ts +4 -0
- package/lib/components/panels/PanelNodeProps.js +0 -0
- package/lib/components/panels/ReferencesPanelItem.d.ts +5 -0
- package/lib/components/panels/ReferencesPanelItem.js +19 -0
- package/lib/components/panels/ServerItem/ServerDescriptionTooltip.d.ts +4 -0
- package/lib/components/panels/ServerItem/ServerDescriptionTooltip.js +1 -0
- package/lib/components/panels/ServerItem/ServerItem.d.ts +5 -0
- package/lib/components/panels/ServerItem/ServerItem.js +40 -0
- package/lib/components/panels/ServerItem/ServerPanelItem.d.ts +5 -0
- package/lib/components/panels/ServerItem/ServerPanelItem.js +1 -0
- package/lib/components/panels/asyncapi/BrokerItem/BrokerBindingsSection.d.ts +7 -0
- package/lib/components/panels/asyncapi/BrokerItem/BrokerBindingsSection.js +1 -0
- package/lib/components/panels/asyncapi/BrokerItem/BrokerModal.d.ts +8 -0
- package/lib/components/panels/asyncapi/BrokerItem/BrokerModal.js +49 -0
- package/lib/components/panels/asyncapi/BrokerItem/BrokerOverviewSection.d.ts +6 -0
- package/lib/components/panels/asyncapi/BrokerItem/BrokerOverviewSection.js +25 -0
- package/lib/components/panels/asyncapi/BrokerItem/BrokerPanel.styled.d.ts +7 -0
- package/lib/components/panels/asyncapi/BrokerItem/BrokerPanel.styled.js +25 -0
- package/lib/components/panels/asyncapi/BrokerItem/BrokerPanelItem.d.ts +5 -0
- package/lib/components/panels/asyncapi/BrokerItem/BrokerPanelItem.js +48 -0
- package/lib/components/panels/asyncapi/ChannelBindingItem/ChannelBindingItem.d.ts +5 -0
- package/lib/components/panels/asyncapi/ChannelBindingItem/ChannelBindingItem.js +32 -0
- package/lib/components/panels/asyncapi/MessageBindingItem/MessageBindingItem.d.ts +5 -0
- package/lib/components/panels/asyncapi/MessageBindingItem/MessageBindingItem.js +1 -0
- package/lib/components/panels/asyncapi/MessageReferencesItem/MessageReferencesItem.d.ts +5 -0
- package/lib/components/panels/asyncapi/MessageReferencesItem/MessageReferencesItem.js +42 -0
- package/lib/components/panels/asyncapi/OperationBindingItem/OperationBindingItem.d.ts +5 -0
- package/lib/components/panels/asyncapi/OperationBindingItem/OperationBindingItem.js +1 -0
- package/lib/components/panels/asyncapi/common/bindingPanel.d.ts +29 -0
- package/lib/components/panels/asyncapi/common/bindingPanel.js +48 -0
- package/lib/components/panels/shared-panel-styles.d.ts +8 -0
- package/lib/components/panels/shared-panel-styles.js +38 -0
- package/lib/components/panels/styled.d.ts +20 -0
- package/lib/components/panels/styled.js +28 -0
- package/lib/components/pluggable/RedocCodeSample.d.ts +12 -0
- package/lib/components/pluggable/RedocCodeSample.js +1 -0
- package/lib/components/pluggable/RedocExample.d.ts +8 -0
- package/lib/components/pluggable/RedocExample.js +7 -0
- package/lib/components/pluggable/RedocResponseSamples.d.ts +9 -0
- package/lib/components/pluggable/RedocResponseSamples.js +1 -0
- package/lib/components/pluggable/RedocSchema.d.ts +12 -0
- package/lib/components/pluggable/RedocSchema.js +1 -0
- package/lib/components/pluggable/index.d.ts +6 -0
- package/lib/components/pluggable/index.js +1 -0
- package/lib/constants/openapi.d.ts +30 -0
- package/lib/constants/openapi.js +1 -0
- package/lib/constants/rendering.d.ts +8 -0
- package/lib/constants/rendering.js +1 -0
- package/lib/contexts/markdownAdapter.d.ts +21 -0
- package/lib/contexts/markdownAdapter.js +1 -0
- package/lib/contexts/telemetry.d.ts +3 -0
- package/lib/contexts/telemetry.js +1 -0
- package/lib/empty-linkedom.d.ts +1 -0
- package/lib/empty-linkedom.js +1 -0
- package/lib/empty.d.ts +7 -0
- package/lib/empty.js +1 -0
- package/lib/events/codeSampleCopy.d.ts +2 -0
- package/lib/events/codeSampleCopy.js +1 -0
- package/lib/events/creator.d.ts +2 -0
- package/lib/events/creator.js +1 -0
- package/lib/events/index.d.ts +8 -0
- package/lib/events/index.js +1 -0
- package/lib/events/languageSwitch.d.ts +2 -0
- package/lib/events/languageSwitch.js +1 -0
- package/lib/events/panelToggle.d.ts +2 -0
- package/lib/events/panelToggle.js +1 -0
- package/lib/events/serverSwitch.d.ts +2 -0
- package/lib/events/serverSwitch.js +1 -0
- package/lib/events/tryItOpen.d.ts +2 -0
- package/lib/events/tryItOpen.js +1 -0
- package/lib/events/tryItSent.d.ts +2 -0
- package/lib/events/tryItSent.js +1 -0
- package/lib/events/types.d.ts +9 -0
- package/lib/events/types.js +1 -0
- package/lib/hoc/withItemId.d.ts +6 -0
- package/lib/hoc/withItemId.js +1 -0
- package/lib/hoc/withReplayPrefetch.d.ts +14 -0
- package/lib/hoc/withReplayPrefetch.js +1 -0
- package/lib/hoc/withRouter.d.ts +4 -0
- package/lib/hoc/withRouter.js +1 -0
- package/lib/hoc/withStoreProvider.d.ts +23 -0
- package/lib/hoc/withStoreProvider.js +1 -0
- package/lib/hooks/useApiDocsRoutes.d.ts +8 -0
- package/lib/hooks/useApiDocsRoutes.js +1 -0
- package/lib/hooks/useApiDocsScroll.d.ts +9 -0
- package/lib/hooks/useApiDocsScroll.js +1 -0
- package/lib/hooks/useBodyScrollLock.d.ts +1 -0
- package/lib/hooks/useBodyScrollLock.js +1 -0
- package/lib/hooks/useCodeHighlight.d.ts +28 -0
- package/lib/hooks/useCodeHighlight.js +1 -0
- package/lib/hooks/useCopyCodeTelemetry.d.ts +13 -0
- package/lib/hooks/useCopyCodeTelemetry.js +1 -0
- package/lib/hooks/useDeepLinkSection.d.ts +16 -0
- package/lib/hooks/useDeepLinkSection.js +1 -0
- package/lib/hooks/useExpandableSection.d.ts +4 -0
- package/lib/hooks/useExpandableSection.js +1 -0
- package/lib/hooks/useHashLinkRedirect.d.ts +4 -0
- package/lib/hooks/useHashLinkRedirect.js +1 -0
- package/lib/hooks/useIsExpanded.d.ts +1 -0
- package/lib/hooks/useIsExpanded.js +1 -0
- package/lib/hooks/useIsHydrated.d.ts +4 -0
- package/lib/hooks/useIsHydrated.js +1 -0
- package/lib/hooks/useLicense.d.ts +6 -0
- package/lib/hooks/useLicense.js +1 -0
- package/lib/hooks/useManualScrollAnchor.d.ts +19 -0
- package/lib/hooks/useManualScrollAnchor.js +1 -0
- package/lib/hooks/useModalDismiss.d.ts +2 -0
- package/lib/hooks/useModalDismiss.js +1 -0
- package/lib/hooks/useNormalizeUrl.d.ts +2 -0
- package/lib/hooks/useNormalizeUrl.js +1 -0
- package/lib/hooks/useRouterHashBridge.d.ts +21 -0
- package/lib/hooks/useRouterHashBridge.js +1 -0
- package/lib/hooks/useScrollSpyUrlSync.d.ts +3 -0
- package/lib/hooks/useScrollSpyUrlSync.js +1 -0
- package/lib/hooks/useTelemetry.d.ts +2 -0
- package/lib/hooks/useTelemetry.js +1 -0
- package/lib/hooks/useTelemetryPageMetrics.d.ts +12 -0
- package/lib/hooks/useTelemetryPageMetrics.js +1 -0
- package/lib/hooks/useTranslate.d.ts +5 -0
- package/lib/hooks/useTranslate.js +1 -0
- package/lib/hooks/useUrlHash.d.ts +7 -0
- package/lib/hooks/useUrlHash.js +1 -0
- package/lib/hooks/useUserScrollIntent.d.ts +18 -0
- package/lib/hooks/useUserScrollIntent.js +1 -0
- package/lib/hooks/useVisitedChannelsTracker.d.ts +6 -0
- package/lib/hooks/useVisitedChannelsTracker.js +1 -0
- package/lib/icons/CSharpIcon/CSharpIcon.d.ts +2 -0
- package/lib/icons/CSharpIcon/CSharpIcon.js +1 -0
- package/lib/icons/CSharpIcon/index.d.ts +1 -0
- package/lib/icons/CSharpIcon/index.js +1 -0
- package/lib/icons/CurlIcon/CurlIcon.d.ts +4 -0
- package/lib/icons/CurlIcon/CurlIcon.js +16 -0
- package/lib/icons/CurlIcon/index.d.ts +1 -0
- package/lib/icons/CurlIcon/index.js +1 -0
- package/lib/icons/DefaultMappingIcon/DefaultMappingIcon.d.ts +4 -0
- package/lib/icons/DefaultMappingIcon/DefaultMappingIcon.js +10 -0
- package/lib/icons/DefaultMappingIcon/index.d.ts +1 -0
- package/lib/icons/DefaultMappingIcon/index.js +1 -0
- package/lib/icons/GOIcon/GOIcon.d.ts +2 -0
- package/lib/icons/GOIcon/GOIcon.js +1 -0
- package/lib/icons/GOIcon/index.d.ts +1 -0
- package/lib/icons/GOIcon/index.js +1 -0
- package/lib/icons/JavaIcon/JavaIcon.d.ts +2 -0
- package/lib/icons/JavaIcon/JavaIcon.js +1 -0
- package/lib/icons/JavaIcon/index.d.ts +1 -0
- package/lib/icons/JavaIcon/index.js +1 -0
- package/lib/icons/JavaScriptIcon/JavaScriptIcon.d.ts +2 -0
- package/lib/icons/JavaScriptIcon/JavaScriptIcon.js +1 -0
- package/lib/icons/JavaScriptIcon/index.d.ts +1 -0
- package/lib/icons/JavaScriptIcon/index.js +1 -0
- package/lib/icons/ListIcon/ListIcon.d.ts +14 -0
- package/lib/icons/ListIcon/ListIcon.js +10 -0
- package/lib/icons/NodeJSIcon/NodeJSIcon.d.ts +2 -0
- package/lib/icons/NodeJSIcon/NodeJSIcon.js +1 -0
- package/lib/icons/NodeJSIcon/index.d.ts +1 -0
- package/lib/icons/NodeJSIcon/index.js +1 -0
- package/lib/icons/PHPIcon/PHPIcon.d.ts +2 -0
- package/lib/icons/PHPIcon/PHPIcon.js +1 -0
- package/lib/icons/PHPIcon/index.d.ts +1 -0
- package/lib/icons/PHPIcon/index.js +1 -0
- package/lib/icons/PayloadIcon/PayloadIcon.d.ts +2 -0
- package/lib/icons/PayloadIcon/PayloadIcon.js +1 -0
- package/lib/icons/PayloadIcon/index.d.ts +1 -0
- package/lib/icons/PayloadIcon/index.js +1 -0
- package/lib/icons/PlusCircleIcon/PlusCircleIcon.d.ts +7 -0
- package/lib/icons/PlusCircleIcon/PlusCircleIcon.js +10 -0
- package/lib/icons/PythonIcon/PythonIcon.d.ts +2 -0
- package/lib/icons/PythonIcon/PythonIcon.js +1 -0
- package/lib/icons/PythonIcon/index.d.ts +1 -0
- package/lib/icons/PythonIcon/index.js +1 -0
- package/lib/icons/RIcon/RIcon.d.ts +2 -0
- package/lib/icons/RIcon/RIcon.js +1 -0
- package/lib/icons/RIcon/index.d.ts +1 -0
- package/lib/icons/RIcon/index.js +1 -0
- package/lib/icons/RubyIcon/RubyIcon.d.ts +2 -0
- package/lib/icons/RubyIcon/RubyIcon.js +1 -0
- package/lib/icons/RubyIcon/index.d.ts +1 -0
- package/lib/icons/RubyIcon/index.js +1 -0
- package/lib/index.d.ts +60 -0
- package/lib/index.js +1 -0
- package/lib/jotai/app.d.ts +76 -0
- package/lib/jotai/app.js +1 -0
- package/lib/jotai/examples.d.ts +5 -0
- package/lib/jotai/examples.js +1 -0
- package/lib/jotai/graphql.d.ts +10 -0
- package/lib/jotai/graphql.js +1 -0
- package/lib/jotai/itemStore.d.ts +49 -0
- package/lib/jotai/itemStore.js +1 -0
- package/lib/jotai/routes.d.ts +4 -0
- package/lib/jotai/routes.js +1 -0
- package/lib/jotai/schema.d.ts +3 -0
- package/lib/jotai/schema.js +1 -0
- package/lib/jotai/store.d.ts +25 -0
- package/lib/jotai/store.js +1 -0
- package/lib/options/constants.d.ts +16 -0
- package/lib/options/constants.js +1 -0
- package/lib/options/helpers.d.ts +26 -0
- package/lib/options/helpers.js +1 -0
- package/lib/options/normalizeOptions.d.ts +2 -0
- package/lib/options/normalizeOptions.js +1 -0
- package/lib/pages/EntryPage.d.ts +25 -0
- package/lib/pages/EntryPage.js +5 -0
- package/lib/pages/GroupPage.d.ts +1 -0
- package/lib/pages/GroupPage.js +47 -0
- package/lib/pages/ItemPage.d.ts +1 -0
- package/lib/pages/ItemPage.js +26 -0
- package/lib/pages/NotFoundPage.d.ts +6 -0
- package/lib/pages/NotFoundPage.js +1 -0
- package/lib/pages/OverviewPage.d.ts +1 -0
- package/lib/pages/OverviewPage.js +11 -0
- package/lib/pages/TopLevelEntryView.d.ts +17 -0
- package/lib/pages/TopLevelEntryView.js +1 -0
- package/lib/services/code-samples/builder.d.ts +38 -0
- package/lib/services/code-samples/builder.js +1 -0
- package/lib/services/code-samples/constants/try-it-loading-state.d.ts +6 -0
- package/lib/services/code-samples/constants/try-it-loading-state.js +1 -0
- package/lib/services/code-samples/convertSampleToString.d.ts +3 -0
- package/lib/services/code-samples/convertSampleToString.js +17 -0
- package/lib/services/code-samples/discriminator.d.ts +39 -0
- package/lib/services/code-samples/discriminator.js +1 -0
- package/lib/services/code-samples/example-key.d.ts +25 -0
- package/lib/services/code-samples/example-key.js +1 -0
- package/lib/services/code-samples/generators/csharp-newtonsoft.d.ts +9 -0
- package/lib/services/code-samples/generators/csharp-newtonsoft.js +2 -0
- package/lib/services/code-samples/generators/csharp.d.ts +9 -0
- package/lib/services/code-samples/generators/csharp.js +2 -0
- package/lib/services/code-samples/generators/curl.d.ts +8 -0
- package/lib/services/code-samples/generators/curl.js +7 -0
- package/lib/services/code-samples/generators/go.d.ts +13 -0
- package/lib/services/code-samples/generators/go.js +3 -0
- package/lib/services/code-samples/generators/helpers/code-builder.d.ts +56 -0
- package/lib/services/code-samples/generators/helpers/code-builder.js +3 -0
- package/lib/services/code-samples/generators/helpers/mime.d.ts +1 -0
- package/lib/services/code-samples/generators/helpers/mime.js +1 -0
- package/lib/services/code-samples/generators/helpers/oauth2-snippets.d.ts +21 -0
- package/lib/services/code-samples/generators/helpers/oauth2-snippets.js +1 -0
- package/lib/services/code-samples/generators/helpers/php-array.d.ts +6 -0
- package/lib/services/code-samples/generators/helpers/php-array.js +5 -0
- package/lib/services/code-samples/generators/helpers/r-utils.d.ts +7 -0
- package/lib/services/code-samples/generators/helpers/r-utils.js +6 -0
- package/lib/services/code-samples/generators/helpers/shell.d.ts +8 -0
- package/lib/services/code-samples/generators/helpers/shell.js +1 -0
- package/lib/services/code-samples/generators/helpers/string-utils.d.ts +4 -0
- package/lib/services/code-samples/generators/helpers/string-utils.js +1 -0
- package/lib/services/code-samples/generators/helpers/stringify-js.d.ts +11 -0
- package/lib/services/code-samples/generators/helpers/stringify-js.js +8 -0
- package/lib/services/code-samples/generators/helpers/sub-request.d.ts +2 -0
- package/lib/services/code-samples/generators/helpers/sub-request.js +1 -0
- package/lib/services/code-samples/generators/helpers/url-helpers.d.ts +17 -0
- package/lib/services/code-samples/generators/helpers/url-helpers.js +2 -0
- package/lib/services/code-samples/generators/index.d.ts +16 -0
- package/lib/services/code-samples/generators/index.js +1 -0
- package/lib/services/code-samples/generators/java.d.ts +9 -0
- package/lib/services/code-samples/generators/java.js +3 -0
- package/lib/services/code-samples/generators/java8.d.ts +9 -0
- package/lib/services/code-samples/generators/java8.js +2 -0
- package/lib/services/code-samples/generators/javascript.d.ts +9 -0
- package/lib/services/code-samples/generators/javascript.js +1 -0
- package/lib/services/code-samples/generators/node.d.ts +10 -0
- package/lib/services/code-samples/generators/node.js +1 -0
- package/lib/services/code-samples/generators/php.d.ts +13 -0
- package/lib/services/code-samples/generators/php.js +6 -0
- package/lib/services/code-samples/generators/python.d.ts +3 -0
- package/lib/services/code-samples/generators/python.js +9 -0
- package/lib/services/code-samples/generators/r.d.ts +10 -0
- package/lib/services/code-samples/generators/r.js +7 -0
- package/lib/services/code-samples/generators/ruby.d.ts +10 -0
- package/lib/services/code-samples/generators/ruby.js +1 -0
- package/lib/services/code-samples/generators/types.d.ts +6 -0
- package/lib/services/code-samples/generators/types.js +0 -0
- package/lib/services/code-samples/har.d.ts +45 -0
- package/lib/services/code-samples/har.js +0 -0
- package/lib/services/code-samples/index.d.ts +8 -0
- package/lib/services/code-samples/index.js +1 -0
- package/lib/services/code-samples/replay/embedded-replay-converter.d.ts +6 -0
- package/lib/services/code-samples/replay/embedded-replay-converter.js +1 -0
- package/lib/services/code-samples/replay/from-openapi-document.d.ts +12 -0
- package/lib/services/code-samples/replay/from-openapi-document.js +1 -0
- package/lib/services/code-samples/replay/har-to-code-sample-har.d.ts +41 -0
- package/lib/services/code-samples/replay/har-to-code-sample-har.js +1 -0
- package/lib/services/code-samples/replay/index.d.ts +8 -0
- package/lib/services/code-samples/replay/index.js +1 -0
- package/lib/services/code-samples/replay/map-servers.d.ts +19 -0
- package/lib/services/code-samples/replay/map-servers.js +1 -0
- package/lib/services/code-samples/replay/merge-configure-into-source.d.ts +17 -0
- package/lib/services/code-samples/replay/merge-configure-into-source.js +1 -0
- package/lib/services/code-samples/replay/normalize-servers.d.ts +3 -0
- package/lib/services/code-samples/replay/normalize-servers.js +1 -0
- package/lib/services/code-samples/replay/overlay-converter.d.ts +15 -0
- package/lib/services/code-samples/replay/overlay-converter.js +1 -0
- package/lib/services/code-samples/replay/replay-adapter.d.ts +5 -0
- package/lib/services/code-samples/replay/replay-adapter.js +1 -0
- package/lib/services/code-samples/replay/replay-handler.d.ts +5 -0
- package/lib/services/code-samples/replay/replay-handler.js +1 -0
- package/lib/services/code-samples/replay/replay-predefined-env.d.ts +4 -0
- package/lib/services/code-samples/replay/replay-predefined-env.js +1 -0
- package/lib/services/code-samples/replay/replay-types.d.ts +75 -0
- package/lib/services/code-samples/replay/replay-types.js +0 -0
- package/lib/services/code-samples/resolvers.d.ts +5 -0
- package/lib/services/code-samples/resolvers.js +1 -0
- package/lib/services/code-samples/sample-har.d.ts +41 -0
- package/lib/services/code-samples/sample-har.js +0 -0
- package/lib/services/code-samples/server-variables.d.ts +11 -0
- package/lib/services/code-samples/server-variables.js +1 -0
- package/lib/services/code-samples/source.d.ts +107 -0
- package/lib/services/code-samples/source.js +0 -0
- package/lib/services/code-samples/use-resolvers.d.ts +2 -0
- package/lib/services/code-samples/use-resolvers.js +1 -0
- package/lib/services/code-samples/utils/map-request-values.d.ts +6 -0
- package/lib/services/code-samples/utils/map-request-values.js +1 -0
- package/lib/services/license/check.d.ts +14 -0
- package/lib/services/license/check.js +1 -0
- package/lib/services/operation-samples/index.d.ts +14 -0
- package/lib/services/operation-samples/index.js +2 -0
- package/lib/services/operation-samples/types.d.ts +37 -0
- package/lib/services/operation-samples/types.js +0 -0
- package/lib/services/schema/dialects/graphqlSchema.d.ts +1 -0
- package/lib/services/schema/dialects/graphqlSchema.js +1 -0
- package/lib/services/schema/dialects/jsonSchema.d.ts +3 -0
- package/lib/services/schema/dialects/jsonSchema.js +1 -0
- package/lib/services/schema/index.d.ts +1 -0
- package/lib/services/schema/index.js +1 -0
- package/lib/services/schema/propertyBuilder.d.ts +32 -0
- package/lib/services/schema/propertyBuilder.js +1 -0
- package/lib/services/schema/propertyTreeBuilder.d.ts +21 -0
- package/lib/services/schema/propertyTreeBuilder.js +1 -0
- package/lib/services/schema/schemaProcessor.d.ts +2 -0
- package/lib/services/schema/schemaProcessor.js +1 -0
- package/lib/services/schema/variant-label.d.ts +6 -0
- package/lib/services/schema/variant-label.js +1 -0
- package/lib/telemetry/RedocTelemetry.d.ts +15 -0
- package/lib/telemetry/RedocTelemetry.js +1 -0
- package/lib/types/asyncapi.d.ts +367 -0
- package/lib/types/asyncapi.js +1 -0
- package/lib/types/common.d.ts +168 -0
- package/lib/types/common.js +1 -0
- package/lib/types/content.d.ts +535 -0
- package/lib/types/content.js +0 -0
- package/lib/types/events.d.ts +75 -0
- package/lib/types/events.js +0 -0
- package/lib/types/graphql-store.d.ts +60 -0
- package/lib/types/graphql-store.js +1 -0
- package/lib/types/graphql.d.ts +54 -0
- package/lib/types/graphql.js +0 -0
- package/lib/types/index.d.ts +10 -0
- package/lib/types/index.js +1 -0
- package/lib/types/openapi.d.ts +586 -0
- package/lib/types/openapi.js +1 -0
- package/lib/types/options.d.ts +260 -0
- package/lib/types/options.js +0 -0
- package/lib/types/pluggable.d.ts +4 -0
- package/lib/types/pluggable.js +0 -0
- package/lib/types/schema.d.ts +155 -0
- package/lib/types/schema.js +1 -0
- package/lib/types/store.d.ts +182 -0
- package/lib/types/store.js +0 -0
- package/lib/utils/calculateMaxLength.d.ts +6 -0
- package/lib/utils/calculateMaxLength.js +1 -0
- package/lib/utils/compose.d.ts +7 -0
- package/lib/utils/compose.js +1 -0
- package/lib/utils/cookies.d.ts +7 -0
- package/lib/utils/cookies.js +1 -0
- package/lib/utils/deep-link.d.ts +146 -0
- package/lib/utils/deep-link.js +1 -0
- package/lib/utils/environments.d.ts +6 -0
- package/lib/utils/environments.js +1 -0
- package/lib/utils/expansion.d.ts +3 -0
- package/lib/utils/expansion.js +1 -0
- package/lib/utils/extract-extensions.d.ts +4 -0
- package/lib/utils/extract-extensions.js +1 -0
- package/lib/utils/fetch-openapi-definition.d.ts +6 -0
- package/lib/utils/fetch-openapi-definition.js +1 -0
- package/lib/utils/form-urlencoded.d.ts +6 -0
- package/lib/utils/form-urlencoded.js +1 -0
- package/lib/utils/graphql-directive-utils.d.ts +6 -0
- package/lib/utils/graphql-directive-utils.js +3 -0
- package/lib/utils/graphql-reference-map.d.ts +3 -0
- package/lib/utils/graphql-reference-map.js +1 -0
- package/lib/utils/graphql-samples.d.ts +25 -0
- package/lib/utils/graphql-samples.js +17 -0
- package/lib/utils/graphql-scopes.d.ts +6 -0
- package/lib/utils/graphql-scopes.js +1 -0
- package/lib/utils/graphql-type-expansion.d.ts +5 -0
- package/lib/utils/graphql-type-expansion.js +1 -0
- package/lib/utils/http-methods.d.ts +8 -0
- package/lib/utils/http-methods.js +1 -0
- package/lib/utils/languages.d.ts +18 -0
- package/lib/utils/languages.js +1 -0
- package/lib/utils/loadAndBundleSpec.d.ts +4 -0
- package/lib/utils/loadAndBundleSpec.js +1 -0
- package/lib/utils/logo.d.ts +8 -0
- package/lib/utils/logo.js +1 -0
- package/lib/utils/media-type.d.ts +7 -0
- package/lib/utils/media-type.js +1 -0
- package/lib/utils/multipart.d.ts +7 -0
- package/lib/utils/multipart.js +1 -0
- package/lib/utils/refPointer.d.ts +2 -0
- package/lib/utils/refPointer.js +1 -0
- package/lib/utils/resolveText.d.ts +2 -0
- package/lib/utils/resolveText.js +1 -0
- package/lib/utils/routing.d.ts +49 -0
- package/lib/utils/routing.js +1 -0
- package/lib/utils/scroll-anchoring.d.ts +3 -0
- package/lib/utils/scroll-anchoring.js +1 -0
- package/lib/utils/security-scope.d.ts +3 -0
- package/lib/utils/security-scope.js +1 -0
- package/lib/utils/serialize-parameter.d.ts +8 -0
- package/lib/utils/serialize-parameter.js +1 -0
- package/lib/utils/serialize-querystring.d.ts +6 -0
- package/lib/utils/serialize-querystring.js +1 -0
- package/lib/utils/session-storage.d.ts +2 -0
- package/lib/utils/session-storage.js +1 -0
- package/lib/utils/split-badges-by-position.d.ts +5 -0
- package/lib/utils/split-badges-by-position.js +1 -0
- package/lib/utils/status-code.d.ts +1 -0
- package/lib/utils/status-code.js +1 -0
- package/lib/utils/string.d.ts +18 -0
- package/lib/utils/string.js +1 -0
- package/lib/utils/telemetry.d.ts +1 -0
- package/lib/utils/telemetry.js +1 -0
- package/lib/utils/url.d.ts +9 -0
- package/lib/utils/url.js +1 -0
- package/lib/utils/xml.d.ts +1 -0
- package/lib/utils/xml.js +1 -0
- package/package.json +97 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { GeneratorOptions } from '../generators/types.js';
|
|
2
|
+
import type { CodeSampleHAR } from '../sample-har.js';
|
|
3
|
+
/**
|
|
4
|
+
* Replay `CodeSample` HAR shape (not exported from `@redocly/replay`).
|
|
5
|
+
* Kept in sync with `packages/replay/src/components/CodeSample/types.ts`.
|
|
6
|
+
*/
|
|
7
|
+
export type ReplayHar = {
|
|
8
|
+
httpVersion: string;
|
|
9
|
+
cookies: {
|
|
10
|
+
name: string;
|
|
11
|
+
value: string;
|
|
12
|
+
}[];
|
|
13
|
+
url: string;
|
|
14
|
+
method: string;
|
|
15
|
+
headers: {
|
|
16
|
+
name: string;
|
|
17
|
+
value: string;
|
|
18
|
+
}[];
|
|
19
|
+
postData: {
|
|
20
|
+
mimeType: string;
|
|
21
|
+
params?: {
|
|
22
|
+
name: string;
|
|
23
|
+
value?: string;
|
|
24
|
+
fileName?: string;
|
|
25
|
+
contentType?: string;
|
|
26
|
+
}[];
|
|
27
|
+
text?: string;
|
|
28
|
+
} | undefined;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Converts Replay Try-it / Generate code HAR into {@link CodeSampleHAR} for api-docs generators.
|
|
32
|
+
*/
|
|
33
|
+
export declare function replayHarToCodeSampleHar(replay: ReplayHar): CodeSampleHAR;
|
|
34
|
+
/**
|
|
35
|
+
* Constructor/instances compatible with Replay `CodeSample` (`new HTTPSnippet(har)` + `convert`).
|
|
36
|
+
*/
|
|
37
|
+
export declare class ReplayCodeSampleHTTPSnippet {
|
|
38
|
+
private readonly har;
|
|
39
|
+
constructor(replayHar: ReplayHar);
|
|
40
|
+
convert(client: string, target: string, options?: GeneratorOptions): string;
|
|
41
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{generateCodeSample as d}from"../generators/index.js";function v(e){try{return JSON.parse(e)}catch{return}}function T(e){if(!e)return;const t=(e.params??[]).map(r=>({name:r.name,value:r.value,fileName:r.fileName,contentType:r.contentType}));return{mimeType:e.mimeType||"application/octet-stream",params:t,text:e.text??""}}function j(e){const t=e.url.trim();let r=t;const s=e.headers.map(n=>({name:n.name,value:n.value})),a={};for(const n of e.headers)a[n.name]=n.value;let u=[];const m={};try{const n=new URL(t.includes("://")?t:`https://${t.replace(/^\/\//,"")}`);r=n.href,n.searchParams.forEach((h,l)=>{u.push({name:l,value:h}),m[l]=h})}catch{u=[]}const i=e.cookies.map(n=>({name:n.name,value:n.value})),o=T(e.postData);let p;o?.text&&o.mimeType.includes("json")&&(p=v(o.text));const f={method:e.method,httpVersion:e.httpVersion||"HTTP/1.1",url:r,cookies:i,headers:s,queryString:u,postData:o,headersSize:-1,bodySize:-1},c={};return i.length&&(c.cookie=i.map(n=>`${encodeURIComponent(n.name)}=${encodeURIComponent(n.value)}`).join("; ")),Object.assign(c,a),{...f,fullUrl:r,headersObj:a,allHeaders:c,queryObj:m,jsonObj:p,pathParameters:{},serverVariables:{},pathname:r}}function y(e,t){if(e==="shell"&&t==="curl")return"curl";if(e==="javascript"&&t==="fetch")return"javascript";if(e==="node"&&t==="fetch")return"node";if(e==="python"&&t==="requests")return"python";if(e==="java"&&t==="httpclient")return"java"}class b{har;constructor(t){this.har=j(t)}convert(t,r,s){const a=y(t,r);return a?d(a,this.har,s):`// Unsupported client/target: ${t} / ${r}`}}export{b as ReplayCodeSampleHTTPSnippet,j as replayHarToCodeSampleHar};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { buildCodeSampleSourceFromDocument } from './from-openapi-document.js';
|
|
2
|
+
export { REPLAY_TRY_IT_LOADING_STATE, type ReplayTryItLoadingState, } from '../constants/try-it-loading-state.js';
|
|
3
|
+
export { createReplayOverlayConverter } from './overlay-converter.js';
|
|
4
|
+
export { createReplayConverter, toReplayOperation } from './replay-adapter.js';
|
|
5
|
+
export { handleReplayParamChange } from './replay-handler.js';
|
|
6
|
+
export { pickRuntimeConfigureRequestValues } from './merge-configure-into-source.js';
|
|
7
|
+
export type { ReplayOverlayApi, ReplayOverlayProps } from './replay-types.js';
|
|
8
|
+
export { ReplayCodeSampleHTTPSnippet, replayHarToCodeSampleHar, type ReplayHar, } from './har-to-code-sample-har.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{buildCodeSampleSourceFromDocument as o}from"./from-openapi-document.js";import{REPLAY_TRY_IT_LOADING_STATE as p}from"../constants/try-it-loading-state.js";import{createReplayOverlayConverter as m}from"./overlay-converter.js";import{createReplayConverter as n,toReplayOperation as R}from"./replay-adapter.js";import{handleReplayParamChange as u}from"./replay-handler.js";import{pickRuntimeConfigureRequestValues as y}from"./merge-configure-into-source.js";import{ReplayCodeSampleHTTPSnippet as T,replayHarToCodeSampleHar as i}from"./har-to-code-sample-har.js";export{p as REPLAY_TRY_IT_LOADING_STATE,T as ReplayCodeSampleHTTPSnippet,o as buildCodeSampleSourceFromDocument,n as createReplayConverter,m as createReplayOverlayConverter,u as handleReplayParamChange,y as pickRuntimeConfigureRequestValues,i as replayHarToCodeSampleHar,R as toReplayOperation};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ReplayServer } from './replay-types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Minimal server shape shared by {@link CodeSampleSource} servers and pre-normalized OpenAPI servers.
|
|
4
|
+
*/
|
|
5
|
+
export type ReplayServerSource = {
|
|
6
|
+
url: string;
|
|
7
|
+
name?: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
variables?: Record<string, {
|
|
10
|
+
default?: string;
|
|
11
|
+
enum?: string[];
|
|
12
|
+
description?: string;
|
|
13
|
+
}>;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Maps normalized server entries to `@redocly/replay` `Server[]`.
|
|
17
|
+
* Returns `[{ url: '/' }]` when the list is empty (Replay default).
|
|
18
|
+
*/
|
|
19
|
+
export declare function mapToReplayServers(sources: ReplayServerSource[]): ReplayServer[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(n){return n.length?n.map(e=>({url:e.url,name:e.name,description:e.description,variables:e.variables&&Object.keys(e.variables).length>0?Object.fromEntries(Object.entries(e.variables).map(([i,r])=>[i,{enum:r.enum,default:r.default??"",description:r.description}])):void 0})):[{url:"/"}]}export{t as mapToReplayServers};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ConfigureRequestValues, ConfigureServerRequestValues } from '@redocly/theme/ext/configure';
|
|
2
|
+
import type { ApiDocsOptions } from '../../../types/options.js';
|
|
3
|
+
import type { ExampleEntry } from '../../../types/store.js';
|
|
4
|
+
import type { CodeSampleSource } from '../source.js';
|
|
5
|
+
export declare function pickRuntimeConfigureRequestValues(options: ApiDocsOptions, hookConfig: ConfigureRequestValues | ConfigureServerRequestValues | null | undefined): ConfigureRequestValues | ConfigureServerRequestValues | undefined;
|
|
6
|
+
/**
|
|
7
|
+
* Appends configure values whose names match no declared parameter as extra
|
|
8
|
+
* entries ({ required: false }, schema-less — `toReplayOperation` stringifies
|
|
9
|
+
* the example and tolerates a missing schema).
|
|
10
|
+
*
|
|
11
|
+
* Embedded (markdoc `replay-openapi` tag) path ONLY: legacy `convertParameters`
|
|
12
|
+
* appended undeclared extras for the embedded tag, but the legacy Try-It
|
|
13
|
+
* overlay never did — keep the overlay converter away from this to preserve
|
|
14
|
+
* parity.
|
|
15
|
+
*/
|
|
16
|
+
export declare function appendUndeclaredConfigureParameters(source: CodeSampleSource, configure: ConfigureRequestValues | ConfigureServerRequestValues): CodeSampleSource;
|
|
17
|
+
export declare function mergeConfigureIntoSourceForReplay(source: CodeSampleSource, configure: ConfigureRequestValues | ConfigureServerRequestValues, exampleStore?: Record<string, ExampleEntry>): CodeSampleSource;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{registerExample as b}from"../../../adapters/helpers.js";import{getEffectiveRequestValues as c,getParamValueMap as o,isDirectRequestValues as V,mergeBodyValue as v,mergeSecurityIntoScheme as h,withServerVariableDefaults as q}from"../../../adapters/openapi/configure/merge-utils.js";function E(e,r){const n=e.dynamicRequestValues;if(n&&Object.keys(n).length>0)return n;if(r&&Object.keys(r).length>0)return r}function g(e,r){return r?e.map(n=>({...n,schemes:n.schemes.map(t=>r[t.id]??r.default?h(t,r):t)})):e}function p(e,r,n){const t=o(r,n);return t?e.map(a=>{const s=t[a.name];return s!==void 0?{...a,example:s}:a}):e}const x=["path","query","header","cookie"];function I(e,r){const n=V(r)?r:c(r,e.servers);if(!n)return e;let t=e.parameters,a=!1;for(const s of x){const i=o(s,n);if(!i)continue;const d=new Set(t[s].map(u=>u.name));if(s==="query")for(const u of t.querystring)d.add(u.name);const m=Object.entries(i).filter(([u,l])=>l!==void 0&&!d.has(u)).map(([u,l])=>({name:u,in:s,required:!1,example:l}));m.length>0&&(t={...t,[s]:[...t[s],...m]},a=!0)}return a?{...e,parameters:t}:e}function y(e,r,n,t){const a=o(r,n);return a?e.map(s=>{const i=a[s.name];return i===void 0?s:{...s,serverValues:{...s.serverValues??{},[t]:{example:i}}}}):e}function O(e,r,n){return r?e.map(t=>({...t,schemes:t.schemes.map(a=>h(a,r,n))})):e}function k(e,r,n){if(!e||r===void 0||!n)return e;const t={};for(const[a,s]of Object.entries(e)){if(!s.exampleIds?.length){t[a]=s;continue}const i=[];for(const d of s.exampleIds){const m=n[d],u=v(m?.value,r),l=b(n,{value:u,summary:m?.summary});i.push(l)}t[a]={...s,exampleIds:i}}return t}function f(e,r,n){const t=r.serverVariables?q(e.servers,r.serverVariables):e.servers;return{...e,servers:t,parameters:{path:p(e.parameters.path,"path",r),query:p(e.parameters.query,"query",r),querystring:p(e.parameters.querystring,"query",r),header:p(e.parameters.header,"header",r),cookie:p(e.parameters.cookie,"cookie",r)},security:g(e.security,r.security),requestBody:k(e.requestBody,r.body,n),requestValues:{...e.requestValues,...r.body!==void 0&&{body:r.body},...r.security&&{security:{...e.requestValues?.security,...r.security}},...r.envVariables&&{envVariables:{...e.requestValues?.envVariables,...r.envVariables}}}}}function S(e,r){let n=e.servers,t=e.security,a=e.parameters;const s={...e.requestValues?.serverBody},i={...e.requestValues?.serverEnvVariables};let d=!1;for(const u of e.servers){const l=r[u.url];l&&(d=!0,l.serverVariables&&(n=q(n,l.serverVariables,u.url)),l.security&&(t=O(t,l.security,u.url)),a={...a,path:y(a.path,"path",l,u.url),query:y(a.query,"query",l,u.url),querystring:y(a.querystring,"query",l,u.url),header:y(a.header,"header",l,u.url),cookie:y(a.cookie,"cookie",l,u.url)},l.body!==void 0&&(s[u.url]=l.body),l.envVariables&&(i[u.url]={...i[u.url],...l.envVariables}))}if(!d)return e;const m={...e.requestValues,...Object.keys(s).length>0&&{serverBody:s},...Object.keys(i).length>0&&{serverEnvVariables:i}};return{...e,servers:n,security:t,parameters:a,requestValues:Object.keys(m).length>0?m:e.requestValues}}function P(e,r,n){if(!r||Object.keys(r).length===0)return e;if(V(r))return f(e,r,n);const t=c(r,e.servers);let a=e;return t&&Object.keys(t).length>0&&(a=f(a,t,n)),a=S(a,r),a}export{I as appendUndeclaredConfigureParameters,P as mergeConfigureIntoSourceForReplay,E as pickRuntimeConfigureRequestValues};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isAbsoluteUrl as l,removeQueryStringAndHash as o,resolveUrl as s}from"../../../adapters/openapi/utils/helpers.js";import{getUrlDirname as i}from"../../../adapters/openapi/utils/url.js";import{IS_BROWSER as u}from"../../../utils/environments.js";function f(e){const t=o(e);if(!t||t.endsWith("/"))return t;const r=t.lastIndexOf("/");return r===-1?"":t.slice(0,r)}function a(e){return e===void 0?o((()=>{if(!u)return globalThis.SSR_HOSTNAME||"";const r=window.location.href;return r.endsWith(".html")&&i(r)||r})()):l(e)?i(e):f(e)}function m(e,t){const r=a(t);return r?s(r,e):e}function S(e,t){let r=t;return r.length===0&&(r=[{url:"/"}]),r.map(n=>({...n,url:m(n.url,e),description:n.description||""}))}export{S as normalizeServers,m as resolveServerUrl};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ConfigureRequestValues, ConfigureServerRequestValues } from '@redocly/theme/ext/configure';
|
|
2
|
+
import type { ReplayNormalizedOpenAPIOperation } from './replay-types.js';
|
|
3
|
+
import type { OpenAPIDefinition, OperationInfo } from '../../../types/openapi.js';
|
|
4
|
+
import type { ApiDocsOptions } from '../../../types/options.js';
|
|
5
|
+
import type { ExampleEntry } from '../../../types/store.js';
|
|
6
|
+
import type { CodeSampleSource } from '../source.js';
|
|
7
|
+
import type { HARBuildResolvers } from '../builder.js';
|
|
8
|
+
/** Resolves adapter-time configure values for a fallback-built operation. Empty/undefined return = no overrides. */
|
|
9
|
+
export type StaticConfigureResolver = (operationInfo: OperationInfo, doc: OpenAPIDefinition) => ConfigureRequestValues | ConfigureServerRequestValues | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* Replay overlay converter: serves operations from the prebuilt source map, falling back
|
|
12
|
+
* to building from the raw document. Both paths share the same `augmentSource` (runtime merge);
|
|
13
|
+
* fallback-built operations additionally run `staticConfigureResolver` when provided.
|
|
14
|
+
*/
|
|
15
|
+
export declare function createReplayOverlayConverter(operationSourceMap: Map<string, CodeSampleSource>, resolvers: HARBuildResolvers, options: ApiDocsOptions, configureReplayHook?: ConfigureRequestValues | ConfigureServerRequestValues | null | undefined, exampleStore?: Record<string, ExampleEntry>, staticConfigureResolver?: StaticConfigureResolver): (path: string, method: string, document: unknown) => ReplayNormalizedOpenAPIOperation | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{buildCodeSampleSourceFromDocument as v}from"./from-openapi-document.js";import{mergeConfigureIntoSourceForReplay as S,pickRuntimeConfigureRequestValues as C}from"./merge-configure-into-source.js";import{createReplayConverter as R,toReplayOperation as b}from"./replay-adapter.js";import{applyRequestValuesToOperationInfo as k}from"../../../adapters/openapi/configure/apply-request-values.js";import{mergeInMockServer as O,pickOperationServers as T}from"../../../adapters/openapi/utils/merge-mock-server.js";import{openApiContext as q}from"../../../adapters/openapi/buildContext.js";function w(c,u,n){return{storeCtx:c,document:u,options:n,basePath:"/",downloadUrls:[],tagsMap:new Map,hasTopLevelTags:!1,collectedTagOrder:[],badgeTags:[],processContent:!0}}function A(c,u,n,f,m,i){const p=C(n,f),s=p?e=>S(e,p,m):void 0,d=i?(e,a,r)=>{const t=i(e,r);if(!t||Object.keys(t).length===0)return;const l=T(e.servers,r.servers).filter(y=>typeof y?.url=="string"),o=O(l,n.mockServer);q.run(w(a,r,n),()=>k(e,t,o))}:void 0,g=R(c,u,s);return(e,a,r)=>{try{const o=g(e,a,r);if(o)return o}catch(o){console.error("[Replay] createReplayConverter error:",o)}if(!r||typeof r!="object")return;const t=v(e,a,r,n,d);if(!t)return;const l=s?s(t):t;return b(l,u)}}export{A as createReplayOverlayConverter};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ReplayNormalizedOpenAPIOperation } from './replay-types.js';
|
|
2
|
+
import type { CodeSampleSource } from '../source.js';
|
|
3
|
+
import type { HARBuildResolvers } from '../builder.js';
|
|
4
|
+
export declare function toReplayOperation(source: CodeSampleSource, resolvers: HARBuildResolvers): ReplayNormalizedOpenAPIOperation;
|
|
5
|
+
export declare function createReplayConverter(operationSourceMap: Map<string, CodeSampleSource>, resolvers: HARBuildResolvers, augmentSource?: (source: CodeSampleSource) => CodeSampleSource): (path: string, method: string, openAPI: unknown) => ReplayNormalizedOpenAPIOperation | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isRecord as h}from"../../../adapters/helpers.js";import{mergeBodyValue as g}from"../../../adapters/openapi/configure/merge-utils.js";import{mapToReplayServers as O}from"./map-servers.js";function x(e){return e.startsWith("#/")?e.slice(2):e}function I(e,a){const t={},n=e.discriminator;if(n?.propertyName&&n.mapping){const i=n.propertyName;for(const[l,o]of Object.entries(n.mapping)){if(typeof o!="string")continue;const s=a.resolveSchema(x(o));if(!s)continue;const p=a.sampleFromSchema(s,{skipReadOnly:!0});p!=null&&(h(p)&&(p[i]=l),t[l]={value:p})}if(Object.keys(t).length>0)return t}if(Array.isArray(e.oneOf)&&e.oneOf.length>0){const i=e.oneOf;for(let l=0;l<i.length;l++){const o=i[l];let s;if(h(o)&&(s=o,typeof o.$ref=="string"&&(s=a.resolveSchema(x(o.$ref))??o)),!s)continue;const p=a.sampleFromSchema(s,{skipReadOnly:!0});if(p==null)continue;const d=typeof s.title=="string"?s.title:`option ${l+1}`;t[d]={value:p}}if(Object.keys(t).length>0)return t}const r=a.sampleFromSchema(e,{skipReadOnly:!0});return r!=null&&(t.default={value:r}),t}function S(e,a,t){const n={};if(e.exampleIds?.length)for(const r of e.exampleIds){const i=a.resolveExample(r);i&&(n[r]={value:i.value,summary:i.summary})}if(Object.keys(n).length===0&&e.schemaId){const r=a.resolveSchema(e.schemaId);r&&Object.assign(n,I(r,a))}if(t!==void 0)if(Object.keys(n).length===0)n.default={value:t};else for(const r of Object.keys(n)){const i=n[r];n[r]={...i,value:g(i.value,t)}}return n}function k(e,a){const t=[],n=(d,f)=>{for(const m of d){const c=m.example;let u;if(m.schemaId){const y=a.resolveSchema(m.schemaId);y&&(u={typePrefix:"",title:y.title??m.name,displayType:y.type??"string",displayFormat:y.format,constraints:[],enum:y.enum??void 0})}t.push({name:m.name,in:f,required:m.required??!1,example:c!=null?String(c):void 0,schema:u})}};n(e.parameters.path,"path"),n(e.parameters.query,"query"),n(e.parameters.header,"header"),n(e.parameters.cookie,"cookie");for(const d of e.parameters.querystring)t.push(v(d,a));const r=O(e.servers),i=e.security.map(d=>d.schemes.map(f=>R(f,d.scopes)));let l;if(e.requestBody){const d=e.requestValues?.body,f={};for(const[m,c]of Object.entries(e.requestBody)){const u=S(c,a,d);f[m]={name:m,examples:Object.keys(u).length>0?u:void 0,schema:c.schemaId?a.resolveSchema(c.schemaId):void 0,parameters:[]}}l={mediaTypes:f}}const o=e.method.toLowerCase(),s=`${o}:${e.path}`,p=e.openApiOperationId??s;return{id:p,name:e.summary||`${e.method.toUpperCase()} ${e.path}`,method:o,path:e.path,href:"",operationId:p,parameters:t,servers:r,security:i,body:l}}function v(e,a){const t=e.schemaId?a.resolveSchema(e.schemaId):void 0,n=e.example!=null?e.example:t?a.sampleFromSchema(t,{skipReadOnly:!0}):void 0,r=b(t,n),i={typePrefix:"",title:t?.title??e.name,displayType:t?.type??"object",constraints:[],...r&&r.length>0?{fields:r}:{},...n!==void 0?{example:n}:{}};return{name:e.name,in:"querystring",required:e.required??!1,schema:i}}function b(e,a){const t=e?.properties;if(!t)return;const n=h(a)?a:{};return Object.keys(t).map(r=>{const i=n[r]!==void 0?n[r]:t[r]?.example;return{name:r,example:i}})}function R(e,a){return{id:e.id,type:e.type,name:e.name,in:e.in==="querystring"?"query":e.in,scheme:e.scheme,openIdConnectUrl:e.openIdConnectUrl,scopes:a,flows:e.flows,"x-defaultAccessToken":e["x-defaultAccessToken"],"x-defaultTokenType":e["x-defaultTokenType"],"x-defaultClientId":e["x-defaultClientId"],"x-defaultClientSecret":e["x-defaultClientSecret"],"x-defaultUsername":e["x-defaultUsername"],"x-defaultPassword":e["x-defaultPassword"],serverValues:e.serverValues}}function C(e,a,t){return(n,r,i)=>{const l=`${r.toLowerCase()}:${n}`,o=e.get(l);if(!o)return;const s=t?t(o):o;return k(s,a)}}export{C as createReplayConverter,k as toReplayOperation};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ReplayOnChangeParams } from '@redocly/replay';
|
|
2
|
+
export declare function handleReplayParamChange(params: ReplayOnChangeParams, setEnvironment: (payload: {
|
|
3
|
+
environment?: string;
|
|
4
|
+
environments?: Record<string, Record<string, string>>;
|
|
5
|
+
}) => void, updateRequestValues: (operationPath: string, operationMethod: string, values: Record<string, unknown>) => void): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function m(n,a,r){(n.environment||n.environments)&&a({environment:n.environment,environments:n.environments});for(const h of n.operations??[]){const{apiPath:t,requestValues:e,activeSecuritySchemeIds:o,activeExampleName:c}=h,i={};e.header&&Object.keys(e.header).length>0&&(i.headers=e.header),e.query&&Object.keys(e.query).length>0&&(i.queryString=e.query),e.cookie&&Object.keys(e.cookie).length>0&&(i.cookies=e.cookie),e.body!==void 0&&(i.body=e.body),o?.length&&(i.activeSecuritySchemeIds=o),c&&(i.activeExampleName=c),n.activeMimeName&&(i.activeMimeName=n.activeMimeName),r(t.path,t.method,i)}}export{m as handleReplayParamChange};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { OpenAPIDefinition, OpenAPIServer } from '../../../types/openapi.js';
|
|
2
|
+
import type { MockServerOptions } from '../../../adapters/openapi/utils/merge-mock-server.js';
|
|
3
|
+
export declare function buildServerEnvValues(servers: OpenAPIServer[]): Record<string, Record<string, string>>;
|
|
4
|
+
export declare function buildReplayPredefinedEnvValues(definition: OpenAPIDefinition, mockServer: MockServerOptions): Record<string, Record<string, string>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{mergeInMockServer as i}from"../../../adapters/openapi/utils/merge-mock-server.js";import{normalizeServers as m}from"./normalize-servers.js";import{getServerEnvName as l}from"../../../utils/environments.js";function f(r){const t=m(void 0,r);return Object.fromEntries(t.map(e=>[String(l(e)),{server:e.url,...Object.fromEntries(Object.entries(e.variables??{}).map(([n,o])=>[n,o.default||""]))}]))}function p(r,t){const e=i((r.servers??[]).filter(n=>typeof n?.url=="string"),t);return f(e)}export{p as buildReplayPredefinedEnvValues,f as buildServerEnvValues};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { ComponentProps } from 'react';
|
|
2
|
+
import type { OperationIn, ReplayOverlay } from '@redocly/replay';
|
|
3
|
+
import type { OpenAPIServer, OpenAPIServerVariable } from '../../../types/openapi.js';
|
|
4
|
+
import type { SecuritySchemeEntry } from '../source.js';
|
|
5
|
+
export type ReplayOverlayProps = ComponentProps<typeof ReplayOverlay>;
|
|
6
|
+
export type ReplayOverlayApi = NonNullable<ReplayOverlayProps['api']>;
|
|
7
|
+
type StringDescription = {
|
|
8
|
+
description?: string;
|
|
9
|
+
};
|
|
10
|
+
export type ReplayServer = Omit<OpenAPIServer, 'description' | 'variables'> & StringDescription & {
|
|
11
|
+
variables?: Record<string, Omit<OpenAPIServerVariable, 'description'> & StringDescription>;
|
|
12
|
+
};
|
|
13
|
+
export type ReplayOperationSecurity = Omit<SecuritySchemeEntry, 'in'> & {
|
|
14
|
+
in?: 'query' | 'header' | 'cookie';
|
|
15
|
+
scopes: string[];
|
|
16
|
+
};
|
|
17
|
+
export type ReplayQuerystringField = {
|
|
18
|
+
name: string;
|
|
19
|
+
example?: unknown;
|
|
20
|
+
};
|
|
21
|
+
export type ReplayOperationParameterSchema = {
|
|
22
|
+
typePrefix: string;
|
|
23
|
+
title: string;
|
|
24
|
+
displayType: string;
|
|
25
|
+
displayFormat?: string;
|
|
26
|
+
contentEncoding?: string;
|
|
27
|
+
constraints: string[];
|
|
28
|
+
enum?: string[];
|
|
29
|
+
fields?: ReplayQuerystringField[];
|
|
30
|
+
example?: unknown;
|
|
31
|
+
};
|
|
32
|
+
export type ReplayOperationParameter = {
|
|
33
|
+
name: string;
|
|
34
|
+
in: OperationIn;
|
|
35
|
+
required: boolean;
|
|
36
|
+
description?: string | {
|
|
37
|
+
raw: string;
|
|
38
|
+
result: unknown;
|
|
39
|
+
};
|
|
40
|
+
example?: unknown;
|
|
41
|
+
schema?: ReplayOperationParameterSchema;
|
|
42
|
+
allowReserved?: boolean;
|
|
43
|
+
};
|
|
44
|
+
export type ReplayMediaType = {
|
|
45
|
+
name: string;
|
|
46
|
+
examples?: Record<string, {
|
|
47
|
+
value: unknown;
|
|
48
|
+
summary?: string | Record<string, unknown>;
|
|
49
|
+
description?: string;
|
|
50
|
+
}>;
|
|
51
|
+
schema?: object;
|
|
52
|
+
parameters: {
|
|
53
|
+
inputType: 'file' | 'text';
|
|
54
|
+
name: string;
|
|
55
|
+
example: string;
|
|
56
|
+
}[];
|
|
57
|
+
};
|
|
58
|
+
export type ReplayMediaTypes = Record<string, ReplayMediaType>;
|
|
59
|
+
export type ReplayNormalizedOpenAPIOperation = {
|
|
60
|
+
id: string;
|
|
61
|
+
name: string;
|
|
62
|
+
method: string;
|
|
63
|
+
path: string;
|
|
64
|
+
href: string;
|
|
65
|
+
operationId?: string;
|
|
66
|
+
parameters: ReplayOperationParameter[];
|
|
67
|
+
body?: {
|
|
68
|
+
mediaTypes: ReplayMediaTypes;
|
|
69
|
+
required?: boolean;
|
|
70
|
+
activeExampleName?: string;
|
|
71
|
+
};
|
|
72
|
+
servers: ReplayServer[];
|
|
73
|
+
security?: ReplayOperationSecurity[][];
|
|
74
|
+
};
|
|
75
|
+
export {};
|
|
File without changes
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { HARBuildResolvers } from './builder.js';
|
|
2
|
+
import type { SchemaEntry, ExampleEntry } from '../../types/store.js';
|
|
3
|
+
import type { ApiDocsOptions } from '../../types/options.js';
|
|
4
|
+
export declare function buildOpenApiStubForSampler(schemaStore: Record<string, SchemaEntry>, activeDiscriminator?: Record<string, number>, activeOneOf?: Record<string, number>): Record<string, unknown>;
|
|
5
|
+
export declare function createCodeSampleResolvers(schemaStore: Record<string, SchemaEntry>, exampleStore: Record<string, ExampleEntry>, options: Pick<ApiDocsOptions, 'onlyRequiredInSamples' | 'generatedSamplesMaxDepth'>, activeDiscriminator?: Record<string, number>, activeOneOf?: Record<string, number>): HARBuildResolvers;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as p from"openapi-sampler";import{serializeParameterValue as l}from"../../utils/serialize-parameter.js";import{applyActiveVariantsToSchema as c,applyActiveVariantsToStore as u,applyDiscriminatorValue as y,hoistActiveVariantSchemaForSampling as d}from"./discriminator.js";function f(t,m,i){const o=u(t,m,i),n={};for(const[a,r]of Object.entries(o)){const e=a.startsWith("components/schemas/")?a.replace("components/schemas/",""):a;n[e]=r}return{openapi:"3.0.0",info:{title:"",version:""},paths:{},components:{schemas:n}}}function k(t,m,i,o,n){const a=f(t,o,n);return{resolveSchema(r){return t[r]?.data},resolveExample(r){const e=m[r];if(e)return{value:e.value,summary:e.summary,key:e.key}},sampleFromSchema(r,e){try{return p.sample(r,{skipReadOnly:e.skipReadOnly,skipWriteOnly:e.skipWriteOnly,quiet:!0,skipNonRequired:i.onlyRequiredInSamples,maxSampleDepth:e.maxDepth??i.generatedSamplesMaxDepth,...e.format==="xml"&&{format:"xml"}},a)}catch{return}},serializeParameter(r,e){return typeof e!="object"||e===null?String(e??""):l({name:r.name,in:r.in},e)},resolveVariantSchemaForSampling(r){const e=d(r,t,o,n),s=e?.schema??t[r]?.data;if(s)return{schema:c(s,t,n),variantSchemaId:e?.variantSchemaId??r}},applyDiscriminatorValue(r,e){!r||typeof r!="object"||Array.isArray(r)||y(r,e,t)}}}export{f as buildOpenApiStubForSampler,k as createCodeSampleResolvers};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type * as HAR from './har.js';
|
|
2
|
+
export type OAuth2PreRequest = HAR.Request & {
|
|
3
|
+
flowType: 'clientCredentials' | 'password' | 'deviceAuthorization';
|
|
4
|
+
tokenUrl: string;
|
|
5
|
+
clientId: string;
|
|
6
|
+
clientSecret?: string;
|
|
7
|
+
username?: string;
|
|
8
|
+
password?: string;
|
|
9
|
+
scopes?: string[];
|
|
10
|
+
};
|
|
11
|
+
export interface CodeSampleHAR extends HAR.Request {
|
|
12
|
+
/** Full URL with query string, server variables unescaped */
|
|
13
|
+
fullUrl: string;
|
|
14
|
+
/** Alias for generators that use `urlFieldName: 'pathname'` (e.g. Java); equals `fullUrl` from {@link buildCodeSampleHAR}. */
|
|
15
|
+
pathname?: string;
|
|
16
|
+
/** Headers as a plain object (convenience for generators) */
|
|
17
|
+
headersObj: Record<string, string>;
|
|
18
|
+
/** Headers + Cookie header synthesized from cookies (parity with openapi-docs prepare()) */
|
|
19
|
+
allHeaders: Record<string, string>;
|
|
20
|
+
/** Query params as a plain object. Duplicate keys collapse into arrays. */
|
|
21
|
+
queryObj: Record<string, string | string[]>;
|
|
22
|
+
/** Parsed JSON body (when postData is JSON) */
|
|
23
|
+
jsonObj?: Record<string, unknown>;
|
|
24
|
+
/** URL-encoded params as a plain object. Duplicate keys collapse into arrays. */
|
|
25
|
+
paramsObj?: Record<string, string | string[]>;
|
|
26
|
+
/** Extracted basic auth credentials (removed from headers) */
|
|
27
|
+
basicAuth?: {
|
|
28
|
+
username: string;
|
|
29
|
+
password: string;
|
|
30
|
+
};
|
|
31
|
+
/** Path parameters: { paramName → resolved value } */
|
|
32
|
+
pathParameters: Record<string, string>;
|
|
33
|
+
/** Server template variables: { varName → resolved value } */
|
|
34
|
+
serverVariables: Record<string, string>;
|
|
35
|
+
/** All response status codes from the operation */
|
|
36
|
+
responseCodes?: string[];
|
|
37
|
+
/** Alias for responseCodes (matches openapi-docs SnippetRequest field name) */
|
|
38
|
+
allResponseCodes?: string[];
|
|
39
|
+
/** OAuth2 pre-request calls for client credentials / device auth flows */
|
|
40
|
+
oAuth2PreRequests?: OAuth2PreRequest[];
|
|
41
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type ServerWithVariables = {
|
|
2
|
+
url: string;
|
|
3
|
+
variables?: Record<string, {
|
|
4
|
+
default?: string;
|
|
5
|
+
}>;
|
|
6
|
+
};
|
|
7
|
+
/** Substitutes `{variable}` placeholders in a server URL with the variables' default values. */
|
|
8
|
+
export declare function replaceServerVariables(server: ServerWithVariables): string;
|
|
9
|
+
/** The environment may hold either the raw (templated) or the substituted server URL — match both. */
|
|
10
|
+
export declare function serverMatchesUrl(server: ServerWithVariables, url: string | undefined): boolean;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a(r){let{url:e,variables:t}=r;if(t)for(const l in t){const n=t[l].default;n!==void 0&&(e=e.replaceAll(`{${l}}`,n))}return e}function f(r,e){return e?r.url===e||a(r)===e:!1}export{a as replaceServerVariables,f as serverMatchesUrl};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import type { OpenAPIParameterLocation } from '../../types/openapi.js';
|
|
2
|
+
import type { SecuritySchemeIn, SecuritySchemeType } from '../../types/common.js';
|
|
3
|
+
import type { OAuthFlowsData, SecuritySchemeCredentials } from '../../types/store.js';
|
|
4
|
+
import type { securitySchemeType } from '../../types/common.js';
|
|
5
|
+
import type { panelKind } from '../../types/common.js';
|
|
6
|
+
export type { OAuthFlowsData, SecuritySchemeCredentials };
|
|
7
|
+
export type ServerVariable = {
|
|
8
|
+
default?: string;
|
|
9
|
+
enum?: string[];
|
|
10
|
+
description?: string;
|
|
11
|
+
};
|
|
12
|
+
export type ServerEntry = {
|
|
13
|
+
url: string;
|
|
14
|
+
name?: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
variables?: Record<string, ServerVariable>;
|
|
17
|
+
/** Set on entries injected by `mergeInMockServer` (never present in specs). */
|
|
18
|
+
isMockServer?: boolean;
|
|
19
|
+
};
|
|
20
|
+
export type ParameterEntry = {
|
|
21
|
+
name: string;
|
|
22
|
+
in: OpenAPIParameterLocation;
|
|
23
|
+
required?: boolean;
|
|
24
|
+
deprecated?: boolean;
|
|
25
|
+
example?: unknown;
|
|
26
|
+
schemaId?: string;
|
|
27
|
+
serializationMime?: string;
|
|
28
|
+
style?: string;
|
|
29
|
+
explode?: boolean;
|
|
30
|
+
/** Per-server example overrides: serverUrl → example value */
|
|
31
|
+
serverValues?: Record<string, {
|
|
32
|
+
example?: unknown;
|
|
33
|
+
}>;
|
|
34
|
+
};
|
|
35
|
+
export type SecuritySchemeEntry = {
|
|
36
|
+
id: string;
|
|
37
|
+
type: Exclude<SecuritySchemeType, typeof securitySchemeType.MUTUAL_TLS>;
|
|
38
|
+
name?: string;
|
|
39
|
+
in?: SecuritySchemeIn;
|
|
40
|
+
scheme?: string;
|
|
41
|
+
bearerFormat?: string;
|
|
42
|
+
openIdConnectUrl?: string;
|
|
43
|
+
flows?: OAuthFlowsData;
|
|
44
|
+
'x-defaultAccessToken'?: string;
|
|
45
|
+
'x-defaultTokenType'?: string;
|
|
46
|
+
'x-defaultClientId'?: string;
|
|
47
|
+
'x-defaultClientSecret'?: string;
|
|
48
|
+
'x-defaultUsername'?: string;
|
|
49
|
+
'x-defaultPassword'?: string;
|
|
50
|
+
/** Per-server auth overrides */
|
|
51
|
+
serverValues?: Record<string, SecuritySchemeCredentials>;
|
|
52
|
+
};
|
|
53
|
+
/** One AND-group: all schemes in the array must be satisfied together */
|
|
54
|
+
export type SecurityRequirement = {
|
|
55
|
+
schemes: SecuritySchemeEntry[];
|
|
56
|
+
scopes: string[];
|
|
57
|
+
};
|
|
58
|
+
export type MediaTypeEntry = {
|
|
59
|
+
schemaId?: string;
|
|
60
|
+
exampleIds?: string[];
|
|
61
|
+
};
|
|
62
|
+
export type DefinitionCodeSample = {
|
|
63
|
+
lang: string;
|
|
64
|
+
label?: string;
|
|
65
|
+
source: string;
|
|
66
|
+
};
|
|
67
|
+
export type CodeSampleRequestValues = {
|
|
68
|
+
security?: Record<string, unknown>;
|
|
69
|
+
envVariables?: Record<string, string>;
|
|
70
|
+
serverEnvVariables?: Record<string, Record<string, string>>;
|
|
71
|
+
body?: unknown;
|
|
72
|
+
serverBody?: Record<string, unknown>;
|
|
73
|
+
};
|
|
74
|
+
export type CodeSampleSource = {
|
|
75
|
+
kind: typeof panelKind.CODE_SAMPLE;
|
|
76
|
+
operationType: 'http' | 'webhook' | 'callback';
|
|
77
|
+
method: string;
|
|
78
|
+
path: string;
|
|
79
|
+
servers: ServerEntry[];
|
|
80
|
+
parameters: {
|
|
81
|
+
path: ParameterEntry[];
|
|
82
|
+
query: ParameterEntry[];
|
|
83
|
+
querystring: ParameterEntry[];
|
|
84
|
+
header: ParameterEntry[];
|
|
85
|
+
cookie: ParameterEntry[];
|
|
86
|
+
};
|
|
87
|
+
security: SecurityRequirement[];
|
|
88
|
+
/** mediaType name → { schemaId, exampleIds } */
|
|
89
|
+
requestBody?: Record<string, MediaTypeEntry>;
|
|
90
|
+
/** Pre-authored code samples from the spec (x-codeSamples) */
|
|
91
|
+
definitionSamples?: DefinitionCodeSample[];
|
|
92
|
+
/** Response status codes (for generators that include expected status) */
|
|
93
|
+
responseCodes?: string[];
|
|
94
|
+
/** Configure request values (security credentials, env vars, per-server env vars) */
|
|
95
|
+
requestValues?: CodeSampleRequestValues;
|
|
96
|
+
/** Raw pointer into the spec (for deep linking) */
|
|
97
|
+
pointer?: string;
|
|
98
|
+
/** Docs route slug of the operation page, relative to the routing base path
|
|
99
|
+
* (e.g. `operations/getmuseumhours`) — used by Replay "View in description" */
|
|
100
|
+
href?: string;
|
|
101
|
+
/** OpenAPI `operationId` — should match the loaded spec so Replay `onRequestChange` can resolve steps */
|
|
102
|
+
openApiOperationId?: string;
|
|
103
|
+
/** OpenAPI operation `summary` — used as the human-readable operation name in Replay (Try It) */
|
|
104
|
+
summary?: string;
|
|
105
|
+
/** OpenAPI `security` array (AND-groups) for multi-scheme UI selection */
|
|
106
|
+
securityGroups?: Array<Record<string, string[]>>;
|
|
107
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useContext as n,useMemo as e}from"react";import{useAtomValue as o}from"jotai";import{schemaStoreAtom as a}from"../../jotai/schema.js";import{activeDiscriminatorSelectAtom as p,activeOneOfSelectAtom as f}from"../../jotai/itemStore.js";import{ItemIdContext as l}from"../../hooks/useDeepLinkSection.js";import{exampleStoreAtom as S}from"../../jotai/examples.js";import{globalOptionsAtom as u}from"../../jotai/store.js";import{createCodeSampleResolvers as v}from"./resolvers.js";function R(){const m=o(a),r=o(S),i=o(u),t=n(l),s=o(e(()=>p(t??""),[t])),c=o(e(()=>f(t??""),[t]));return e(()=>v(m,r,i,s,c),[m,r,i,s,c])}export{R as useCodeSampleResolvers};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Maps values stored from Replay (`handleReplayParamChange`) into the shape
|
|
3
|
+
* expected by `buildCodeSampleHAR` selections (`tryItValues` per location).
|
|
4
|
+
* Request body is passed separately as `HARBuildSelections.replayBody` (see `CodeSampleItem`).
|
|
5
|
+
*/
|
|
6
|
+
export declare function mapReplayAtomValuesToHarRequestValues(v: Record<string, unknown>): Record<string, Record<string, unknown>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function o(e){const t={};return e.headers&&typeof e.headers=="object"&&(t.header=e.headers),e.queryString&&typeof e.queryString=="object"&&(t.query=e.queryString),e.cookies&&typeof e.cookies=="object"&&(t.cookie=e.cookies),e.path&&typeof e.path=="object"&&(t.path=e.path),t}export{o as mapReplayAtomValuesToHarRequestValues};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type LicenseInfo = {
|
|
2
|
+
t?: boolean;
|
|
3
|
+
i?: number;
|
|
4
|
+
e?: number;
|
|
5
|
+
h?: string[] | true;
|
|
6
|
+
valid?: boolean;
|
|
7
|
+
expired?: boolean;
|
|
8
|
+
allowed?: boolean;
|
|
9
|
+
local?: boolean;
|
|
10
|
+
cryptoMissing?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare function isHostAllowed(hostname: string, hosts: string[] | boolean | undefined): boolean;
|
|
13
|
+
export declare function parseLicense(key?: string): Promise<LicenseInfo>;
|
|
14
|
+
export default parseLicense;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a="MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAMHjNir5fXx/ZXoaEeXQ5XyxbNJ4YJYczoCRdSkL6NLzw1FHnng5Vfcgk5+bvox9QRYRbuk84mA4f2NhywDbXKECAwEAAQ==",o=typeof window<"u"&&(window.crypto||window.msCrypto)||void 0;function u(e){return"then"in e?e:new Promise(t=>{e.oncomplete=n=>{t(n.target.result)}})}function f(e){const t=new ArrayBuffer(e.length),n=new Uint8Array(t);for(let i=0,r=e.length;i<r;i++)n[i]=e.charCodeAt(i);return t}function l(e){if(typeof TextEncoder<"u")return new TextEncoder().encode(e);const t=unescape(encodeURIComponent(e)),n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return n}function c(){const e=f(atob(typeof REDOCLY_PUBLIC_KEY<"u"?REDOCLY_PUBLIC_KEY:a));return u(o.subtle.importKey("spki",e,{name:"RSASSA-PKCS1-v1_5",hash:"SHA-256"},!0,["verify"]))}async function d(e,t){return u(o.subtle.verify({name:"RSASSA-PKCS1-v1_5",hash:"SHA-256"},await c(),f(atob(t)),l(e)))}function s(e,t){return t===!0?!0:Array.isArray(t)&&typeof window<"u"?e==="localhost"||e==="127.0.0.1"||e.endsWith(".localhost")||t.find(n=>n===e||e.endsWith("."+n))?!0:!!t.find(n=>{if(n.indexOf("*")!==n.lastIndexOf("*"))return!1;const[i,r]=n.split("*");return!!r&&e.startsWith(i)&&e.endsWith(r)&&r.split(".").length>2}):!1}async function w(e){if(process.env.NODE_ENV==="development")return{valid:!0,allowed:!0};const t=window.location.hostname;if(!e)return t==="localhost"||t==="127.0.0.1"||t.endsWith(".localhost")?{local:!0}:{};const[n,i]=e.split(".");let r;try{if(!await d(atob(n),i))return{valid:!1};r=JSON.parse(atob(n))}catch{return{valid:!1,cryptoMissing:!0}}return r.valid=!0,(!r.e||Date.now()/1e3>r.e)&&(r.expired=!0),r.allowed=s(t,r.h),r}var p=w;export{p as default,s as isHostAllowed,w as parseLicense};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { OpenAPIDefinition } from '../../types/openapi.js';
|
|
2
|
+
import type { ApiDocsOptions } from '../../types/options.js';
|
|
3
|
+
import type { CodeSampleAttributes, CodeSampleBlock, MediaSampleBlock, OperationSampleContext, OperationSampleIdentifier } from './types.js';
|
|
4
|
+
export type * from './types.js';
|
|
5
|
+
export declare function resolveOperationSampleContext(doc: OpenAPIDefinition, options: ApiDocsOptions, identifier: OperationSampleIdentifier): OperationSampleContext | undefined;
|
|
6
|
+
export declare function buildCodeSamples(ctx: OperationSampleContext, attributes?: CodeSampleAttributes): CodeSampleBlock[];
|
|
7
|
+
export declare function getRequestBodySamples(ctx: OperationSampleContext, { exampleKey, mimeType, titlePrefix, }?: {
|
|
8
|
+
exampleKey?: string;
|
|
9
|
+
mimeType?: string;
|
|
10
|
+
titlePrefix?: string;
|
|
11
|
+
}): MediaSampleBlock[];
|
|
12
|
+
export declare function getResponseSamples(ctx: OperationSampleContext, { exampleKey }?: {
|
|
13
|
+
exampleKey?: string;
|
|
14
|
+
}): MediaSampleBlock[];
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import*as B from"openapi-sampler";import{createStoreContext as I,resolveContent as C,resolveRef as h,toRecord as u}from"../../adapters/helpers.js";import{populateOpenApiStore as M}from"../../adapters/openapi/store.js";import{buildCodeSampleSource as N}from"../../adapters/openapi/build-code-sample-source.js";import{resolveOpenApiExampleValue as w}from"../../adapters/openapi/resolve-openapi-example-value.js";import{JsonPointer as b}from"../../adapters/openapi/utils/JsonPointer.js";import{createCodeSampleResolvers as A}from"../code-samples/resolvers.js";import{buildCodeSampleHAR as P}from"../code-samples/builder.js";import{tryGenerateCodeSample as T}from"../code-samples/generators/index.js";import{convertSampleToString as E}from"../code-samples/convertSampleToString.js";import{encodeExampleForMediaType as K,isSampleableMediaType as D,isSequentialMediaType as V,langFromMime as W}from"../../utils/media-type.js";import{getGeneratorKey as $,getLangKey as g}from"../../utils/languages.js";import{getServerEnvName as q}from"../../utils/environments.js";import{isOperationName as R}from"../../utils/http-methods.js";import{isStatusCode as F}from"../../utils/status-code.js";let v=null;function G(t,e){const n=e.ignoreNamedSchemas,o=n?[...n].sort().join(`
|
|
2
|
+
`):"";if(v?.doc===t&&v.optionsKey===o)return v.ctx;const r=I(u(t));return M(t,r,e),v={doc:t,optionsKey:o,ctx:r},r}function L(t,e){const n=t.paths;if(!(!n||typeof n!="object")){for(const[o,r]of Object.entries(n))if(!(!r||typeof r!="object"))for(const[s,i]of Object.entries(r)){if(!R(s)||!i||typeof i!="object")continue;const a=i;if(a.operationId===e)return{pathName:o,method:s,operation:a,pointer:b.compile(["paths",o,s])}}}}function U(t,e){const n=b.parse(e),o=n.indexOf("paths"),r=o>=0?n[o+1]:void 0,s=o>=0?n[o+2]:void 0;if(!r||!s||!R(s))return;const a=t.paths?.[r]?.[s];if(!(!a||typeof a!="object"))return{pathName:r,method:s,operation:a,pointer:b.compile(["paths",r,s])}}function H(t,{operationId:e,pointer:n}){if(e)return L(t,e);if(n)return U(t,n)}function ue(t,e,n){const o=H(t,n);if(!o)return;const{pathName:r,method:s,operation:i,pointer:a}=o,p=t.paths?.[r]??{},l={pointer:a,pathName:r,httpVerb:s.toUpperCase(),operationId:i.operationId,summary:typeof i.summary=="string"?i.summary:void 0,isWebhook:!1,isAdditionalOperation:!1,tags:i.tags??[],parameters:J(t,p.parameters,i.parameters),requestBody:i.requestBody,responses:i.responses,servers:i.servers??p.servers??t.servers,security:i.security},m=G(t,e),d=N(l,m,e,e.ignoreNamedSchemas),O=i["x-codeSamples"];O?.length&&(d.definitionSamples=O.map(({lang:S,label:c,source:f})=>({lang:S,label:c,source:f})));const y=A(m.schemaStore,m.exampleStore,e);return{doc:t,options:e,operation:i,pathName:r,method:s,source:d,storeCtx:m,resolvers:y}}function J(t,e,n){if(!e?.length)return n;if(!n?.length)return e;const o=u(t),r=a=>{const p=h(o,a)??a;return`${p.in}:${p.name}`},s=new Set(n.map(r));return[...e.filter(a=>!s.has(r(a))),...n]}function z(t,{environment:e,environments:n}){let o=t;if(e){const r=o.filter(s=>String(q(s))===e||s.url===e);o=r.length?r:o}return n&&(o=o.map(r=>{const s=n[String(q(r))]?.server;return s?{...r,url:s}:r})),o}function le(t,e={}){const{source:n,options:o}=t,r=o.codeSamples?.languages??[],s=new Map(r.map((c,f)=>[c.key,f])),i=z(n.servers,e),a=e.environment&&e.environments?.[e.environment]||{},p=(n.definitionSamples??[]).filter(c=>s.has(g(c))&&typeof c.source=="string"),l=new Set(p.map(g)),m={serverUrl:i[0]?.url??a.server,mediaType:e.mimeType,exampleName:e.exampleKey,environment:a,requestValues:e.parameters,replayBody:e.requestBody},d={skipOptionalParameters:o.codeSamples?.skipOptionalParameters,withOAuth2Call:o.codeSamples?.withOAuth2Call,generatedPayloadSamplesMaxDepth:o.generatedSamplesMaxDepth},y=n.operationType==="webhook"?void 0:P({...n,servers:i},m,d,t.resolvers),S=[];if(y)for(const c of r){const f=$(c);if(f==="payload"||l.has(c.key))continue;const x=T(f,y,c.options),k=x.kind==="ok"?x.source:x.kind==="unsupported-language"?"Language is not supported.":"Failed to generate code sample.";k&&S.push({lang:c.lang,label:c.label,source:k})}return[...p,...S].filter(c=>!!c.source).sort((c,f)=>(s.get(g(c))??9999)-(s.get(g(f))??9999))}function Q(t,e,n){if(e.examples&&typeof e.examples=="object"){const o=Object.keys(e.examples);if(o.length){const r=o.length===1?o[0]:n&&o.includes(n)?n:o[0],s=h(u(t),e.examples[r])??e.examples[r],i=w(s);if(i!==void 0)return i}}if(e.example!==void 0)return e.example}function X(t,e,n,o){const r=e.schema??e.itemSchema;if(!r)return;const s=h(u(t),r)??r;try{return B.sample(s,{skipReadOnly:o==="request",skipWriteOnly:o==="response",quiet:!0,skipNonRequired:n.onlyRequiredInSamples,maxSampleDepth:n.generatedSamplesMaxDepth},u(t))}catch{return}}function j(t,e,n,o,r,s){const i=[];if(!e)return i;for(const[a,p]of Object.entries(e)){if(!p||typeof p!="object"||s&&a!==s)continue;let l=Q(t.doc,p,n);const m=l===void 0&&D(a);if(m&&(l=X(t.doc,p,t.options,r)),l===void 0)continue;const d=E(l,a,p.schema??p.itemSchema,m&&V(a));d!==void 0&&i.push({lang:W(a),title:`${o} ${a}`,source:K(d,a,p.encoding)})}return i}function fe(t,{exampleKey:e,mimeType:n,titlePrefix:o="Payload"}={}){const r=h(u(t.doc),t.operation.requestBody)??t.operation.requestBody,s=C(u(t.doc),r);return j(t,s,e,o,"request",n)}function de(t,{exampleKey:e}={}){const n=t.operation.responses;if(!n||typeof n!="object")return[];const o=[];for(const[r,s]of Object.entries(n)){if(!F(r))continue;const i=h(u(t.doc),s)??s,a=C(u(t.doc),i);o.push(...j(t,a,e,r,"response"))}return o}export{le as buildCodeSamples,fe as getRequestBodySamples,de as getResponseSamples,ue as resolveOperationSampleContext};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { OpenAPIDefinition, OpenAPIOperation } from '../../types/openapi.js';
|
|
2
|
+
import type { ApiDocsOptions } from '../../types/options.js';
|
|
3
|
+
import type { StoreContext } from '../../types/store.js';
|
|
4
|
+
import type { CodeSampleSource } from '../code-samples/source.js';
|
|
5
|
+
import type { HARBuildResolvers } from '../code-samples/builder.js';
|
|
6
|
+
export type OperationSampleIdentifier = {
|
|
7
|
+
operationId?: string;
|
|
8
|
+
pointer?: string;
|
|
9
|
+
};
|
|
10
|
+
export type CodeSampleBlock = {
|
|
11
|
+
lang: string;
|
|
12
|
+
label?: string;
|
|
13
|
+
source: string;
|
|
14
|
+
};
|
|
15
|
+
export type MediaSampleBlock = {
|
|
16
|
+
lang: string;
|
|
17
|
+
title: string;
|
|
18
|
+
source: string;
|
|
19
|
+
};
|
|
20
|
+
export type CodeSampleAttributes = {
|
|
21
|
+
exampleKey?: string;
|
|
22
|
+
mimeType?: string;
|
|
23
|
+
parameters?: Record<string, Record<string, unknown>>;
|
|
24
|
+
requestBody?: unknown;
|
|
25
|
+
environments?: Record<string, Record<string, string>>;
|
|
26
|
+
environment?: string;
|
|
27
|
+
};
|
|
28
|
+
export type OperationSampleContext = {
|
|
29
|
+
doc: OpenAPIDefinition;
|
|
30
|
+
options: ApiDocsOptions;
|
|
31
|
+
operation: OpenAPIOperation;
|
|
32
|
+
pathName: string;
|
|
33
|
+
method: string;
|
|
34
|
+
source: CodeSampleSource;
|
|
35
|
+
storeCtx: StoreContext;
|
|
36
|
+
resolvers: HARBuildResolvers;
|
|
37
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const GraphqlSchemaDialectId: 'graphql-schema';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a="graphql-schema";export{a as GraphqlSchemaDialectId};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{merge as $,openApiJsonSchemaMergeRules as A}from"@redocly/allof-merge";import{schemaKind as M}from"../../../types/common.js";import{isSchemaNode as p}from"../../../types/schema.js";import{encodeJsonPointerSegment as w}from"../../../utils/refPointer.js";import{buildPropertyTree as j}from"../propertyTreeBuilder.js";function k(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function S(e,i){if(!i.startsWith("#/"))return;const c=i.slice(2).split("/").map(k);let n=e;for(const t of c){if(!p(n))return;n=n[t]}return p(n)?n:void 0}function g(e,i,c,n){if(!e||typeof e!="object")return e;if(Array.isArray(e)){const r=c??new Set;return e.map(f=>g(f,i,r,n))}if(!p(e))return e;const t=c??new Set;if(e.$ref!==void 0){const r=e.$ref;if(typeof r!="string")return e;if(t.has(r)){const o=S(i,r);return p(o)?{...o,"x-circular-ref":!0,"x-original-ref":r}:{"x-circular-ref":!0}}const f=n?.get(r);if(f&&p(f)){const o={};for(const[m,d]of Object.entries(e))m!=="$ref"&&(o[m]=g(d,i,t,n));return{...f,...o,"x-original-ref":r}}const l=S(i,r);if(!l)return e;t.add(r);const s=g(l,i,t,n);t.delete(r);const a={};for(const[o,m]of Object.entries(e))o!=="$ref"&&(a[o]=g(m,i,t,n));return p(s)?(n?.set(r,s),{...s,...a,"x-original-ref":r}):s}return Object.fromEntries(Object.entries(e).map(([r,f])=>[r,g(f,i,t,n)]))}function b(e,i,c,n){const t="openapi"in i?i.openapi:void 0,r=typeof t=="string"&&t.startsWith("3.0")?"3.0.x":"3.1.x",f=g(e,i,n,c),l=p(f)?f:e,s=$(l,{mergeCombinarySibling:!0,applyAdditionalPropertiesToSiblings:!1,rules:A(r)});return p(s)?s:l}const x=new WeakMap;function P(e){const i=x.get(e);if(i)return i;const c=e.components?.schemas,n={};if(c&&typeof c=="object")for(const[t,r]of Object.entries(c)){if(!p(r)||!Array.isArray(r.allOf))continue;const f=typeof r["x-discriminator-value"]=="string"?r["x-discriminator-value"]:t,l=`#/components/schemas/${w(t)}`;for(const s of r.allOf)p(s)&&typeof s.$ref=="string"&&(n[s.$ref]??=[]).push({ref:l,value:f})}return x.set(e,n),n}const O=new WeakMap;function y(e,i){if(!p(e)){if(Array.isArray(e))for(const t of e)y(t,i);return}for(const[t,r]of Object.entries(e))t==="$ref"&&typeof r=="string"?i.add(r):y(r,i);const c=e.discriminator??e["x-discriminator"],n=p(c)?c.mapping:void 0;if(p(n))for(const t of Object.values(n))typeof t=="string"&&i.add(t)}function D(e){const i=new Set;let c=0;const n=new Map,t=new Map,r=new Set,f=[];for(const l of e.keys()){if(n.has(l))continue;const s=[{node:l,edge:0}];for(;s.length>0;){const a=s[s.length-1],{node:o}=a;a.edge===0&&(n.set(o,c),t.set(o,c),c++,f.push(o),r.add(o));const m=e.get(o)??[];if(a.edge<m.length){const u=m[a.edge];if(a.edge++,!e.has(u))continue;n.has(u)?r.has(u)&&t.set(o,Math.min(t.get(o)??0,n.get(u)??0)):s.push({node:u,edge:0});continue}if((t.get(o)??0)===(n.get(o)??0)){const u=[];let h="";do h=f.pop()??o,r.delete(h),u.push(h);while(h!==o);const R=(e.get(u[0])??[]).includes(u[0]);if(u.length>1||R)for(const v of u)i.add(v)}s.pop();const d=s[s.length-1];d&&t.set(d.node,Math.min(t.get(d.node)??0,t.get(o)??0))}}return i}function J(e){const i=O.get(e);if(i)return i;const c=e.components?.schemas,n=new Map;if(c&&typeof c=="object"){const r=s=>`#/components/schemas/${w(s)}`,f=s=>s.replace(/^#\/components\/schemas\//,"").replace(/~1/g,"/").replace(/~0/g,"~"),l=s=>{const a=c[f(s)];return p(a)&&!!(a.discriminator||a["x-discriminator"])};for(const[s,a]of Object.entries(c)){const o=new Set;y(a,o),n.set(r(s),[...o])}for(const[s,a]of Object.entries(c))if(!(!p(a)||!Array.isArray(a.allOf)))for(const o of a.allOf)p(o)&&typeof o.$ref=="string"&&l(o.$ref)&&n.get(o.$ref)?.push(r(s))}const t=D(n);return O.set(e,t),t}const W=M.JSON_SCHEMA,q={id:W,process(e,i,c){const n=new Map,t=c?.rootJsonPointer??"#",r=t.startsWith("#/")&&e.$ref!==t?new Set([t]):void 0,f=b(e,i,n,r),l={prepareVariant:s=>b(s,i,n),propertyRefCache:new Map,variantResolutionCache:new Map,implicitDiscriminatorChildren:P(i),exampleSerializer:c?.exampleSerializer,sortRequiredPropsFirst:c?.sortRequiredPropsFirst,activeRefs:t.startsWith("#/")?new Set([t]):new Set,depth:0,recursiveRefs:J(i)};return j(f,l,t)}};export{W as JsonSchemaDialectId,q as jsonSchemaDialect};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { schemaProcessor as processSchema } from './schemaProcessor.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{schemaProcessor as o}from"./schemaProcessor.js";export{o as processSchema};
|