@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 @@
|
|
|
1
|
+
import{LayoutVariant as o}from"@redocly/config";import{apiSpecType as i}from"../types/common.js";import{DEFAULT_LAYOUT as f}from"./constants.js";import{DEFAULT_LANGUAGES as p,getLangKey as s}from"../utils/languages.js";function u(r,t){return r===void 0?t??!1:typeof r=="string"?r!=="false":r}function A(r,t=0){return typeof r=="string"?parseInt(r,10):typeof r=="number"?r:t}function a(r,t=0){return typeof r=="string"?parseInt(r,10):typeof r=="number"?Math.ceil(r):t}function x(r,t){return r===void 0?t:r==="all"?1/0:a(r,t)}function h(r){let t=r;return t.length>1&&t.endsWith("/")&&(t=t.slice(0,-1)),t.startsWith("/")||(t="/"+t),t}function T(r){if(typeof r>"u")return!1;if(r==="")return!0;if(typeof r!="string")return r;switch(r){case"true":return!0;case"false":return!1;default:return r.split(",").map(t=>t.trim()).filter(Boolean)}}function c(r){return/^-?\d+(\.\d+)?$/.test(r)}function E(r){return typeof r=="number"?()=>r:typeof r=="string"&&c(r)?()=>parseFloat(r):typeof r=="function"?()=>{const t=r();return typeof t=="number"?t:0}:()=>0}function L(r){const t=typeof r=="object"&&r!==null?r:{},e=t.languages??p.map(({label:n})=>({lang:n}));return{...t,languages:e.map(n=>({...n,key:s(n),label:n.label??n.lang}))}}function b(r){return Array.isArray(r)?r:typeof r=="string"?r.split(",").map(t=>t.trim()):[]}function S(r,t){return r.map(e=>({...e,title:e.title??m(e.url,t)}))}function m(r,t){const e=r.split("?")[0].split(/[\\/]/).pop();if(e&&["yaml","json","gql","graphql"].some(n=>e.includes(n)))return e;switch(t){case i.OPENAPI:return"openapi.yaml";case i.ASYNCAPI:return"asyncapi.yaml";case i.GRAPHQL:return"graphql.gql";default:return"description.json"}}function N(r){return r===void 0?f:r===o.STACKED?o.STACKED:o.THREE_PANEL}function z(r){return r.specType===i.GRAPHQL&&u(r.sidebar?.hide,!1)}export{u as argValueToBoolean,x as argValueToExpandLevel,a as argValueToInt,A as argValueToNumber,z as isGraphqlDocsSidebarHidden,L as normalizeCodeSamples,S as normalizeDownloadUrls,b as normalizeIgnoreNamedSchemas,N as normalizeLayout,h as normalizePath,E as normalizeScrollYOffset,T as normalizeShowExtensions};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{addTrailingSlash as d}from"@redocly/theme/core/openapi";import{WindowReferenceOptions as m}from"../constants/openapi.js";import{argValueToBoolean as a,argValueToExpandLevel as r,argValueToInt as l,argValueToNumber as S,normalizeCodeSamples as i,normalizeDownloadUrls as n,normalizeIgnoreNamedSchemas as E,normalizeLayout as h,normalizePath as c,normalizeScrollYOffset as u,normalizeShowExtensions as _}from"./helpers.js";import{ASYNCAPI_DEFAULT_JSON_SAMPLES_DEPTH as L,DEFAULT_FEEDBACK as f,DEFAULT_MAX_DISPLAYED_ENUM_VALUES as P,GENERATED_SAMPLES_MAX_DEPTH_DEFAULT as A,GRAPHQL_DEFAULT_FIELD_EXPAND_LEVEL as D,GRAPHQL_DEFAULT_JSON_SAMPLES_DEPTH as t,GRAPHQL_DEFAULT_SAMPLES_MAX_INLINE_ARGS as T,JSON_SAMPLES_EXPAND_LEVEL_DEFAULT as s,MOCK_SERVER_DEFAULT_DESCRIPTION as I,MOCK_SERVER_DEFAULT_POSITION as x,DEFAULT_ROUTING_BASE_PATH as R}from"./constants.js";import{apiSpecType as U}from"../types/common.js";function b(e){return{specType:e.specType,licenseKey:e.licenseKey,metadata:e.metadata??{},downloadUrls:n(e.downloadUrls??[],e.specType),userClaims:e.userClaims,dynamicRequestValues:e.dynamicRequestValues,schemaDefinitionsTagName:e.schemaDefinitionsTagName,corsProxyUrl:e.corsProxyUrl?d(e.corsProxyUrl):void 0,hideSidebar:a(e.hideSidebar,!1),jsonSamplesExpandLevel:r(e.jsonSamplesExpandLevel,s)??s,generatedSamplesMaxDepth:l(e.generatedSamplesMaxDepth,A),hideDownloadButtons:a(e.hideDownloadButtons,!1),hideInfoMetadata:a(e.hideInfoMetadata,!1),hideLoading:a(e.hideLoading,!1),hideSchemaTitles:a(e.hideSchemaTitles,!1),hideSchemaPattern:a(e.hideSchemaPattern,!1),maxDisplayedEnumValues:S(e.maxDisplayedEnumValues,P),mockServer:e.mockServer?.url?{url:e.mockServer.url,position:e.mockServer.position||x,description:e.mockServer.description||I}:void 0,hideReplay:a(e.hideReplay,!1),oAuth2RedirectURI:e.oAuth2RedirectURI,onlyRequiredInSamples:a(e.onlyRequiredInSamples,!1),[m.ON_DEEP_LINK_CLICK]:e.onDeepLinkClick??null,basePath:e.basePath?c(e.basePath):R,schemasExpansionLevel:r(e.schemasExpansionLevel),feedback:e.feedback??f,sortRequiredPropsFirst:a(e.sortRequiredPropsFirst??e.requiredPropsFirst,!1),scrollYOffset:u(e.scrollYOffset),showExtensions:_(e.showExtensions),sanitize:a(e.sanitize,!1),skipBundle:a(e.skipBundle,!1),ignoreNamedSchemas:new Set(E(e.ignoreNamedSchemas)),markdocOptions:e.markdocOptions,markdownParser:e.markdownParser,codeSamples:i(e.codeSamples),layout:h(e.layout),events:e.events??{},unstable_hooks:e.unstable_hooks??{},unstable_skipSamples:a(e.unstable_skipSamples,!1),unstable_externalCodeSamples:e.unstable_externalCodeSamples??[],hidePropertiesPrefix:a(e?.hidePropertiesPrefix,!1),showSchemaCatalogLinks:a(e?.showSchemaCatalogLinks,!1),baseUrlPath:e.baseUrlPath,jsonSamplesDepth:l(e.jsonSamplesDepth,e.specType===U.ASYNCAPI?L:t),samplesMaxInlineArgs:l(e.samplesMaxInlineArgs,T),fieldExpandLevel:l(e.fieldExpandLevel,D),menu:e.menu,sidebar:e.sidebar,showBuiltInScalars:e.showBuiltInScalars,showBuiltInDirectives:e.showBuiltInDirectives,info:e.info,markdown:e.markdown,apiLogo:e.apiLogo,protocol:e.protocol}}export{b as normalizeOptions};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { RouteIndex } from '../utils/routing.js';
|
|
3
|
+
type EntryPageProps = {
|
|
4
|
+
routeIndex: RouteIndex;
|
|
5
|
+
basePath: string;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Renders the whole API as one persistent tree with two layers of laziness:
|
|
9
|
+
*
|
|
10
|
+
* 1. **Top-level LazySections** — one per top-level entry (root page,
|
|
11
|
+
* every top-level tag, any standalone non-tag route). Each
|
|
12
|
+
* observer-mounts when scrolled near the viewport and stays mounted.
|
|
13
|
+
*
|
|
14
|
+
* 2. **Ops inside a tag** — when the tag is in scope (active route OR an
|
|
15
|
+
* ancestor of the active route), every op renders as a nested
|
|
16
|
+
* LazySection. The active op is eager; the rest are placeholders that
|
|
17
|
+
* observer-mount on scroll. When the tag goes out of scope, its ops
|
|
18
|
+
* unmount; the active op of the new tag becomes eager.
|
|
19
|
+
*
|
|
20
|
+
* Section pointer routes (`route.content === null`) live inside the root
|
|
21
|
+
* page's overview body — when one is active, the root page is eager.
|
|
22
|
+
*/
|
|
23
|
+
declare function EntryPageComponent({ routeIndex, basePath }: EntryPageProps): ReactElement;
|
|
24
|
+
export declare const EntryPage: import("react").MemoExoticComponent<typeof EntryPageComponent>;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{jsx as a,jsxs as L}from"react/jsx-runtime";import{memo as R,useEffect as b,useMemo as p}from"react";import{styled as A}from"styled-components";import{useAtomValue as u}from"jotai";import{useLocation as M}from"react-router-dom";import{LayoutVariant as S}from"@redocly/config";import{ThreePanelLayout as T}from"@redocly/theme/layouts/ThreePanelLayout";import{layoutAtom as C,collapsedSidebarAtom as O}from"../jotai/app.js";import{globalOptionsAtom as j}from"../jotai/store.js";import{contentType as x}from"../types/common.js";import{markSectionRendered as D}from"../components/common/LazySection.js";import{MiddlePanel as F}from"../components/common/ContentWrapper.js";import{NotFoundPage as I}from"./NotFoundPage.js";import{TopLevelEntryView as V}from"./TopLevelEntryView.js";import{buildTopLevelEntries as _,buildEagerSlugs as B,resolveRouteByPathname as K}from"../utils/routing.js";import{useApiDocsScroll as N}from"../hooks/useApiDocsScroll.js";import{useHashLinkRedirect as $}from"../hooks/useHashLinkRedirect.js";import{useIsHydrated as w}from"../hooks/useIsHydrated.js";import{RenderHook as v}from"../components/RenderHook.js";function G({routeIndex:o,basePath:m}){const f=u(C),P=u(O),g=M(),i=w(),{unstable_hooks:l}=u(j),n=p(()=>K(o,g.pathname),[o,g.pathname]),s=p(()=>_(o),[o]),c=p(()=>B(n,o),[n,o]);b(()=>{c.forEach(e=>D(e))},[c]),N({activeRoute:n,routeIndex:o,basePath:m,isHydrated:i});const k=$(m,o),t=n?.path,H=p(()=>{if(i||!t)return s;const e=s.findIndex(r=>r.sectionId===t||r.children.some(h=>h.path===t));return e>0?s.slice(e):s},[s,t,i]);return!n&&o.allRoutes.length>0?a(I,{routingBasePath:m}):L(T,{className:"api-content",id:"api-content",layout:f,collapsedSidebar:P,onClickCapture:k,children:[l?.MiddlePanelHeader&&a(E,{$isStacked:f===S.STACKED,"data-testid":"middle-panel-header",children:a(v,{Hook:l.MiddlePanelHeader,props:void 0})}),H.map(e=>{const r=e.children.findIndex(d=>d.path===t),h=!i&&r>0?r:0,y=i||r===-1;return a(V,{entry:e,activePath:t,entryEager:c.has(e.sectionId),eagerOpSlug:e.children.find(d=>c.has(d.path))?.path??null,opsStartIndex:h,renderEntrySection:y,shouldRenderOps:e.sectionId===t||e.children.some(d=>d.path===t)||e.children.length>0&&e.content.contentType!==x.GROUP},e.sectionId)}),l?.MiddlePanelFooter&&a(E,{$isStacked:f===S.STACKED,"data-testid":"middle-panel-footer",children:a(v,{Hook:l.MiddlePanelFooter,props:void 0})})]})}const ce=R(G),E=A(F)`
|
|
2
|
+
align-self: flex-start;
|
|
3
|
+
padding-top: var(--panel-gap-vertical);
|
|
4
|
+
padding-bottom: var(--panel-gap-vertical);
|
|
5
|
+
`;export{ce as EntryPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const GroupPage: import("react").FC<any>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import{jsx as l,jsxs as u}from"react/jsx-runtime";import{memo as S,useMemo as b}from"react";import{styled as c}from"styled-components";import{useNavigate as A}from"react-router-dom";import{useAtomValue as f}from"jotai";import{LayoutVariant as B}from"@redocly/config";import{Button as C}from"@redocly/theme/components/Button/Button";import{breakpoints as h}from"@redocly/theme/core/openapi";import{layoutAtom as T}from"../jotai/app.js";import{routingBasePathAtom as z}from"../jotai/store.js";import{toElementId as I}from"../utils/url.js";import{SECTION_ATTR as N}from"../constants/openapi.js";import{panelKind as j}from"../types/common.js";import{Breadcrumbs as G}from"../components/common/Breadcrumbs.js";import{ComponentMapper as M}from"../components/Mapper.js";import{useSpecTranslate as U}from"../hooks/useTranslate.js";import{useIsExpanded as _}from"../hooks/useIsExpanded.js";import{useNormalizeUrl as L,useNavigationUrlNormalizer as K}from"../hooks/useNormalizeUrl.js";import{compose as O}from"../utils/compose.js";import{withItemId as R}from"../hoc/withItemId.js";function V(r,o){const a=o.split("/").filter(Boolean),n=r.length,e=a.slice(0,a.length-n);return r.map((s,i)=>({label:s.label,link:"/"+[...e,...a.slice(e.length,e.length+i)].join("/")}))}function q(r){for(const o of r?.children??[]){const a=o?.panels;if(Array.isArray(a)&&a.some(n=>n?.children?.some(e=>e?.kind===j.GROUP_ITEMS)))return!0}return!1}function D({content:r,itemPath:o,sectionId:a}){const{meta:n,children:e}=r||{},s=U(),i=A(),d=_(o),v=L(o),p=K(),x=f(T)===B.STACKED,g=b(()=>q(r),[r]),m=b(()=>n?.breadcrumbs?V(n.breadcrumbs,o).map(t=>({name:t.label,href:p(t.link)})):void 0,[n?.breadcrumbs,o,p]),w=s("actions.show","Show"),y=f(z),k=a?{[N]:a}:{},$=o?I(o,y):void 0;return u(P,{id:$,...k,$isExpanded:d,$isExpandable:g,children:[m&&m.length>0&&l(F,{$isStacked:x,children:l(G,{breadcrumbs:m,onClick:i})}),e.map((t,E)=>l(M,{type:t.nodeType,node:t,itemPath:o},`${o}-${t.nodeType}-${E}`)),!d&&g&&u(W,{type:"button",variant:"text",size:"medium",onClick:()=>i(v),children:["+ ",w]})]})}const bo=O(R,S)(D),P=c.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
width: 100%;
|
|
5
|
+
padding-top: calc(var(--spacing-unit) * 16);
|
|
6
|
+
padding-bottom: ${({$isExpanded:r,$isExpandable:o})=>r||!o?"var(--spacing-lg)":"0"};
|
|
7
|
+
|
|
8
|
+
blockquote {
|
|
9
|
+
margin-top: var(--spacing-sm);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
[data-testid="external-documentation"] {
|
|
13
|
+
margin: var(--spacing-xxs) 0 0;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
${({$isExpanded:r,$isExpandable:o})=>(!r||!o)&&`
|
|
17
|
+
border-bottom: 1px solid var(--border-color-secondary);
|
|
18
|
+
`}
|
|
19
|
+
|
|
20
|
+
/* Collapsed operation-groups get the grey layer background; leaf/expanded stay white. */
|
|
21
|
+
${({$isExpanded:r,$isExpandable:o})=>!r&&o&&`
|
|
22
|
+
background-color: var(--layer-color);
|
|
23
|
+
--code-block-bg-color: var(--bg-color);
|
|
24
|
+
--code-block-controls-bg-color: var(--bg-color);
|
|
25
|
+
`}
|
|
26
|
+
`,W=c(C)`
|
|
27
|
+
margin: var(--spacing-md) var(--spacing-xl) var(--spacing-xxs);
|
|
28
|
+
width: calc(100% - var(--spacing-xl) * 2);
|
|
29
|
+
|
|
30
|
+
@media screen and (min-width: ${h.medium}) {
|
|
31
|
+
--button-margin-md: calc(var(--spacing-xl) * 2);
|
|
32
|
+
|
|
33
|
+
margin-left: var(--button-margin-md);
|
|
34
|
+
margin-right: var(--button-margin-md);
|
|
35
|
+
width: calc(100% - var(--button-margin-md) * 2);
|
|
36
|
+
}
|
|
37
|
+
`,F=c.div`
|
|
38
|
+
width: 100%;
|
|
39
|
+
min-width: 0;
|
|
40
|
+
padding: var(--spacing-sm) var(--panel-gap-horizontal) 0;
|
|
41
|
+
|
|
42
|
+
@media screen and (min-width: ${h.large}) {
|
|
43
|
+
width: ${({$isStacked:r})=>r?"100%":"calc(100% - var(--panel-samples-width))"};
|
|
44
|
+
padding-left: calc(var(--panel-gap-horizontal) * 2);
|
|
45
|
+
padding-right: var(--panel-gap-horizontal);
|
|
46
|
+
}
|
|
47
|
+
`;export{bo as GroupPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ItemPage: import("react").FC<any>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import{jsx as r,jsxs as m}from"react/jsx-runtime";import{Fragment as v,memo as u}from"react";import{styled as p}from"styled-components";import{useAtomValue as s}from"jotai";import{ComponentMapper as k}from"../components/Mapper.js";import{SchemaCatalogLink as I}from"../components/SchemaCatalogLink.js";import{RenderHook as c}from"../components/RenderHook.js";import{ContentWrapper as l}from"../components/common/ContentWrapper.js";import{globalOptionsAtom as x,routingBasePathAtom as y}from"../jotai/store.js";import{compose as A}from"../utils/compose.js";import{toElementId as O}from"../utils/url.js";import{withItemId as C}from"../hoc/withItemId.js";import{SECTION_ATTR as T}from"../constants/openapi.js";function j({content:o,itemPath:e,sectionId:a}){const{children:f}=o||{},i=o?.meta?.pointer,{unstable_hooks:n}=s(x),b=s(y),g=a?{[T]:a}:{},h=e?O(e,b):void 0;return m(P,{id:h,...g,"data-item-kind":o.itemVariant,"data-has-divider":o.showDivider||void 0,children:[r(c,{Hook:n?.BeforeOperation,props:{operation:o}}),f?.map((t,d)=>m(v,{children:[r(k,{type:t.nodeType,node:t,itemPath:e}),d===0&&i&&r(l,{children:r(I,{schemaRef:"#"+i})})]},`${e}-${t.nodeType}-${d}`)),r(c,{Hook:n?.AfterOperation,props:{operation:o}}),o.showDivider&&r(l,{children:r(w,{})})]})}const N=A(C,u)(j),w=p.div`
|
|
2
|
+
border-bottom: 1px solid var(--border-color-secondary);
|
|
3
|
+
`,P=p.div`
|
|
4
|
+
padding-top: calc(var(--spacing-unit) * 16);
|
|
5
|
+
padding-bottom: var(--spacing-base);
|
|
6
|
+
border-bottom: 1px solid var(--border-color-secondary);
|
|
7
|
+
width: 100%;
|
|
8
|
+
|
|
9
|
+
&[data-item-kind^='channel'] {
|
|
10
|
+
padding-top: calc(var(--spacing-unit) * 16);
|
|
11
|
+
padding-bottom: 0;
|
|
12
|
+
|
|
13
|
+
[data-component-name='FeedbackItem'] {
|
|
14
|
+
margin: 0;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&[data-item-kind='channel'],
|
|
19
|
+
&[data-has-divider] {
|
|
20
|
+
border-bottom: none;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&[data-item-kind='channelOperation']:not([data-has-divider]) {
|
|
24
|
+
border-bottom: 1px solid var(--border-color-secondary);
|
|
25
|
+
}
|
|
26
|
+
`;export{N as ItemPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e,jsxs as o}from"react/jsx-runtime";import{Link as c,useLocation as i}from"react-router-dom";import{useNormalizeUrl as d}from"../hooks/useNormalizeUrl.js";function m({routingBasePath:n}){const t=i(),a=d(n||"/");return e("div",{className:"not-found-page",children:o("div",{className:"not-found-content",children:[e("h1",{children:"404"}),e("h2",{children:"Page Not Found"}),o("p",{children:["The page ",e("code",{children:t.pathname})," could not be found."]}),e("p",{children:"This documentation page doesn't exist. It may have been moved or deleted."}),e(c,{to:a,className:"back-link",children:"\u2190 Back to API Documentation"})]})})}export{m as NotFoundPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const OverviewPage: import("react").FC<any>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{jsx as r,jsxs as m}from"react/jsx-runtime";import{Fragment as s,memo as d}from"react";import{styled as c}from"styled-components";import{useAtomValue as f}from"jotai";import{ComponentMapper as l}from"../components/Mapper.js";import{RenderHook as v}from"../components/RenderHook.js";import{globalOptionsAtom as g}from"../jotai/store.js";import{compose as x}from"../utils/compose.js";import{withItemId as h}from"../hoc/withItemId.js";function u({content:t,itemPath:e}){const{children:n}=t||{},{unstable_hooks:p,metadata:a}=f(g);return r(w,{children:n?.map((o,i)=>m(s,{children:[r(l,{type:o.nodeType,node:o},`${e}-${o.nodeType}`),i===0&&r(v,{Hook:p?.AfterApiTitle,props:{info:a??{}}})]},`${e}-${o.nodeType}`))})}const _=x(h,d)(u),w=c.div`
|
|
2
|
+
padding: var(--spacing-xs) 0 var(--spacing-xxl) 0;
|
|
3
|
+
border-bottom: 1px solid var(--border-color-secondary);
|
|
4
|
+
|
|
5
|
+
[data-testid='middle-panel'] > :first-child {
|
|
6
|
+
padding-top: calc(var(--spacing-unit) * 7);
|
|
7
|
+
}
|
|
8
|
+
[data-component-name='Markdown/Markdown'] :is(h1, h2, h3, h4, h5, h6) {
|
|
9
|
+
padding-top: var(--spacing-xs);
|
|
10
|
+
}
|
|
11
|
+
`;export{_ as OverviewPage};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { TopLevelEntry } from '../utils/routing.js';
|
|
3
|
+
type TopLevelEntryViewProps = {
|
|
4
|
+
entry: TopLevelEntry;
|
|
5
|
+
activePath: string | undefined;
|
|
6
|
+
entryEager: boolean;
|
|
7
|
+
eagerOpSlug: string | null;
|
|
8
|
+
shouldRenderOps: boolean;
|
|
9
|
+
opsStartIndex?: number;
|
|
10
|
+
renderEntrySection?: boolean;
|
|
11
|
+
};
|
|
12
|
+
/** Renders one top-level entry as a LazySection plus, when in scope, its op
|
|
13
|
+
* LazySections. The op LazySections are siblings (not children) of the
|
|
14
|
+
* entry's LazySection so the entry's memo bail doesn't keep a stale `eager`
|
|
15
|
+
* prop on the active op during sibling-op navigation. */
|
|
16
|
+
export declare const TopLevelEntryView: import("react").MemoExoticComponent<({ entry, activePath, entryEager, eagerOpSlug, shouldRenderOps, opsStartIndex, renderEntrySection, }: TopLevelEntryViewProps) => ReactElement>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Fragment as l,jsx as n,jsxs as T}from"react/jsx-runtime";import{memo as g}from"react";import{ComponentMapper as r}from"../components/Mapper.js";import{contentType as p}from"../types/common.js";import{LazySection as s}from"../components/common/LazySection.js";function x(o,t){return t?t===o||t.startsWith(o+"/"):!1}const L=g(function({entry:t,activePath:a,entryEager:c,eagerOpSlug:i,shouldRenderOps:m,opsStartIndex:u=0,renderEntrySection:f=!0}){const I=t.content.contentType===p.GROUP;return T(l,{children:[f&&n(s,{sectionId:t.sectionId,eager:c,children:n(r,{sectionId:t.sectionId,type:t.content.contentType??p.OVERVIEW,content:t.content,itemPath:t.path})}),m&&t.children.slice(u).map(e=>e.content===null||I&&!x(e.gatePath,a)?null:n(s,{sectionId:e.path,eager:e.path===i,children:n(r,{sectionId:e.path,type:e.content.contentType,content:e.content,itemPath:e.path})},e.path))]})});export{L as TopLevelEntryView};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { CodeSampleHAR } from './sample-har.js';
|
|
2
|
+
import type { CodeSampleSource, ParameterEntry } from './source.js';
|
|
3
|
+
export type HARBuildSelections = {
|
|
4
|
+
serverUrl?: string;
|
|
5
|
+
mediaType?: string;
|
|
6
|
+
exampleName?: string;
|
|
7
|
+
activeSecuritySchemeIds?: string[];
|
|
8
|
+
environment?: Record<string, string>;
|
|
9
|
+
requestValues?: Record<string, Record<string, unknown>>;
|
|
10
|
+
/** Request body from Replay Try It (`onRequestChange`) — takes precedence over examples/schema sampling */
|
|
11
|
+
replayBody?: unknown;
|
|
12
|
+
};
|
|
13
|
+
export type HARBuildOptions = {
|
|
14
|
+
skipOptionalParameters?: boolean;
|
|
15
|
+
withOAuth2Call?: boolean;
|
|
16
|
+
generatedPayloadSamplesMaxDepth?: number;
|
|
17
|
+
};
|
|
18
|
+
export type HARBuildResolvers = {
|
|
19
|
+
resolveSchema: (schemaId: string) => Record<string, unknown> | undefined;
|
|
20
|
+
resolveExample: (exampleId: string) => {
|
|
21
|
+
value: unknown;
|
|
22
|
+
summary?: string;
|
|
23
|
+
key?: string;
|
|
24
|
+
} | undefined;
|
|
25
|
+
sampleFromSchema: (schema: Record<string, unknown>, options: {
|
|
26
|
+
skipReadOnly?: boolean;
|
|
27
|
+
skipWriteOnly?: boolean;
|
|
28
|
+
maxDepth?: number;
|
|
29
|
+
format?: string;
|
|
30
|
+
}) => unknown;
|
|
31
|
+
serializeParameter?: (param: ParameterEntry, value: unknown) => string;
|
|
32
|
+
resolveVariantSchemaForSampling?: (schemaId: string) => {
|
|
33
|
+
schema: Record<string, unknown>;
|
|
34
|
+
variantSchemaId: string;
|
|
35
|
+
} | undefined;
|
|
36
|
+
applyDiscriminatorValue?: (sample: unknown, variantSchemaId: string) => void;
|
|
37
|
+
};
|
|
38
|
+
export declare function buildCodeSampleHAR(source: CodeSampleSource, selections: HARBuildSelections, options: HARBuildOptions, resolvers: HARBuildResolvers): CodeSampleHAR;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import $ from"url-template";import{SecurityVariablesEnvSuffix as g}from"@redocly/theme/core/openapi";import{mergeBodyValue as F}from"../../adapters/openapi/configure/merge-utils.js";import{formUrlEncodeValue as H,stringifyFormFieldValue as E}from"../../utils/form-urlencoded.js";import{isSequentialMediaType as K}from"../../utils/media-type.js";import{parseMultipartFormData as M}from"../../utils/multipart.js";import{objectToHarParams as J}from"../../utils/serialize-querystring.js";import{jsonToXml as L}from"../../utils/xml.js";import{MediaTypes as k}from"../../constants/openapi.js";import{convertSampleToString as Y}from"./convertSampleToString.js";import{findExampleIdByKey as Q,mediaTypeContainingKey as X}from"./example-key.js";import{resolveServerUrl as G}from"./replay/normalize-servers.js";import{serverMatchesUrl as W}from"./server-variables.js";function Ie(e,n,a,r){const o=e.servers.find(f=>W(f,n.serverUrl))||e.servers[0],u=o?.url?.replace(/\/$/,"")??"",c=u?G(u).replace(/\/$/,""):"",t={};if(o?.variables)for(const[f,A]of Object.entries(o.variables))t[f]=n.environment?.[f]||A.default||"";const l=e.path.replace(/^\//,""),i=`${c}/${l}`,d={skipReadOnly:!0,maxDepth:a.generatedPayloadSamplesMaxDepth??8,format:"json"},s=o?.url??n.serverUrl??"",p=n.requestValues??{},m=Z(e.security,n.activeSecuritySchemeIds),y=ee(m,n,a,s),S=b(e.parameters.header,"header",s,p,a,r,d).concat(y.headers),h=n.mediaType||X(e.requestBody,n.exampleName,r.resolveExample)||(e.requestBody?Object.keys(e.requestBody)[0]:void 0);let R=!1;for(const f of S)f.name.toLowerCase()==="content-type"&&h&&(f.value=h,R=!0);!R&&h&&S.unshift({name:"Content-Type",value:h});const v=b(e.parameters.cookie,"cookie",s,p,a,r,d).concat(y.cookies),O=e.parameters.querystring.length>0,C=b(O?e.parameters.querystring:e.parameters.query,O?"querystring":"query",s,p,a,r,d).concat(y.queries),U={};for(const f of e.parameters.path)U[f.name]=p.path?.[f.name]||f.serverValues?.[s]?.example||f.example||"";let x;if(h&&e.requestBody?.[h]){const f=e.requestBody[h],A=e.requestValues?.serverBody?.[s]??e.requestValues?.body;x=le(f,h,n,r,d,s,A)}const w={};for(const f of S)w[f.name]=f.value;const I={};v.length&&(I.cookie=v.map(f=>`${encodeURIComponent(f.name)}=${encodeURIComponent(f.value)}`).join("; ")),Object.assign(I,w);const j={};for(const f of C)V(j,f.name,f.value);const B=x?.text?ue(x.text):void 0;let _;if(x?.params?.length){_={};for(const f of x.params)V(_,f.name,f.value??"")}const P=C.map(f=>`${encodeURIComponent(f.name)}=${encodeURIComponent(f.value)}`).join("&"),q=P?`${i}?${P}`:i;return{method:e.method.toUpperCase(),url:i,pathname:q,httpVersion:"HTTP/1.1",cookies:v,headers:S,queryString:C,postData:x,headersSize:-1,bodySize:-1,fullUrl:q,headersObj:w,allHeaders:I,queryObj:j,jsonObj:B,paramsObj:_,basicAuth:y.basicAuth,pathParameters:U,serverVariables:t,responseCodes:e.responseCodes,allResponseCodes:e.responseCodes,oAuth2PreRequests:y.oAuth2PreRequests}}function V(e,n,a){const r=e[n];r===void 0?e[n]=a:Array.isArray(r)?r.push(a):e[n]=[r,a]}function Z(e,n){if(e.length){if(n?.length){const a=e.find(r=>{const o=r.schemes.map(u=>u.id);return o.length===n.length&&o.every(u=>n.includes(u))});if(a)return a}return e[0]}}function ee(e,n,a,r){const o={headers:[],cookies:[],queries:[]};if(!e)return o;for(const u of e.schemes)ne(u,o,n,a,r,e.scopes);return o}const te={"x-defaultUsername":g.Username,"x-defaultPassword":g.Password,"x-defaultClientId":g.ClientId,"x-defaultClientSecret":g.ClientSecret};function ne(e,n,a,r,o,u=[]){const c=a.requestValues?.security,t=l=>{const i=e.serverValues?.[o];if(i){const y=i[l];if(y!=null)return String(y)}const d=e[l];if(d!=null&&typeof d=="string")return d;const s=c?.[l];if(s!=null)return String(s);const p=l==="x-defaultAccessToken"?e.type==="apiKey"?g.APIKey:g.Token:te[l],m=p!==void 0?a.environment?.[e.id+p]:void 0;if(m)return m};if(e.type==="http"&&e.scheme==="basic")n.basicAuth={username:t("x-defaultUsername")||c?.username||"<username>",password:t("x-defaultPassword")||c?.password||"<password>"};else if(e.type==="http"){const l=t("x-defaultAccessToken"),i=e.scheme||"bearer",d=i.charAt(0).toUpperCase()+i.slice(1),s=e.bearerFormat?`<YOUR_${e.bearerFormat}_HERE>`:"<YOUR_TOKEN_HERE>";n.headers.push({name:"Authorization",value:l?`${d} ${l}`:`${d} ${s}`})}else if(e.type==="apiKey"&&e.name){const l=t("x-defaultAccessToken")||"YOUR_API_KEY_HERE",i={name:e.name,value:l};e.in==="header"?n.headers.push(i):e.in==="cookie"?n.cookies.push({name:e.name,value:l}):(e.in==="query"||e.in==="querystring"||e.in===void 0)&&n.queries.push({name:e.name,value:l})}else if(e.type==="oauth2"){const l=t("x-defaultAccessToken"),i=t("x-defaultTokenType")||"Bearer";if(n.headers.push({name:"Authorization",value:l?`${i} ${l}`:"Bearer <YOUR_TOKEN_HERE>"}),r.withOAuth2Call&&e.flows){const d=[];if(e.flows.deviceAuthorization){const s=e.flows.deviceAuthorization;d.push(ae(s.deviceAuthorizationUrl,s.tokenUrl,e,o,u))}else if(e.flows.clientCredentials){const s=e.flows.clientCredentials;d.push(z("clientCredentials",s.tokenUrl,e,o,u))}else if(e.flows.password){const s=e.flows.password;d.push(z("password",s.tokenUrl,e,o,u))}d.length>0&&(n.oAuth2PreRequests=(n.oAuth2PreRequests??[]).concat(d))}}else if(e.type==="openIdConnect"){const l=t("x-defaultAccessToken"),i=t("x-defaultTokenType")||"Bearer";n.headers.push({name:"Authorization",value:l?`${i} ${l}`:"Bearer <YOUR_TOKEN_HERE>"})}}function ae(e,n,a,r,o=[]){const u=a.serverValues?.[r]?.["x-defaultClientId"]||a["x-defaultClientId"]||"YOUR_CLIENT_ID",c=[{name:"client_id",value:u}];return o.length>0&&c.push({name:"scope",value:o.join(" ")}),{flowType:"deviceAuthorization",tokenUrl:n,clientId:u,scopes:o.length>0?o:void 0,method:"POST",url:e,httpVersion:"HTTP/1.1",cookies:[],headers:[{name:"Content-Type",value:"application/x-www-form-urlencoded"},{name:"Accept",value:"application/json"}],queryString:[],postData:{mimeType:"application/x-www-form-urlencoded",params:c,text:c.map(t=>`${encodeURIComponent(t.name)}=${encodeURIComponent(t.value??"")}`).join("&")},headersSize:-1,bodySize:-1}}function z(e,n,a,r,o=[]){const u=a.serverValues?.[r]?.["x-defaultClientId"]||a["x-defaultClientId"]||"YOUR_CLIENT_ID",c=a.serverValues?.[r]?.["x-defaultClientSecret"]||a["x-defaultClientSecret"],t=a.serverValues?.[r]?.["x-defaultUsername"]||a["x-defaultUsername"],l=a.serverValues?.[r]?.["x-defaultPassword"]||a["x-defaultPassword"],i=[];return e==="clientCredentials"?i.push({name:"grant_type",value:"client_credentials"}):e==="password"&&i.push({name:"grant_type",value:"password"}),i.push({name:"client_id",value:u}),i.push({name:"client_secret",value:c||"YOUR_CLIENT_SECRET"}),e==="password"&&(i.push({name:"username",value:t||"<username>"}),i.push({name:"password",value:l||"<password>"})),o.length>0&&i.push({name:"scope",value:o.join(" ")}),{flowType:e,tokenUrl:n,clientId:u,clientSecret:c,username:t,password:l,scopes:o.length>0?o:void 0,method:"POST",url:n,httpVersion:"HTTP/1.1",cookies:[],headers:[{name:"Content-Type",value:"application/x-www-form-urlencoded"},{name:"Accept",value:"application/json"}],queryString:[],postData:{mimeType:"application/x-www-form-urlencoded",params:i,text:i.map(d=>`${encodeURIComponent(d.name)}=${encodeURIComponent(d.value??"")}`).join("&")},headersSize:-1,bodySize:-1}}function N(e,n,a){return n==="querystring"&&e.serializationMime===k.URL_ENCODED&&typeof a=="object"&&a!==null?re(J(a)):null}function re(e){const n=new Map,a=[];for(const r of e){const o=n.get(r.name);o?o.push(r.value):(n.set(r.name,[r.value]),a.push(r.name))}return a.map(r=>({name:r,value:(n.get(r)??[]).join(",")}))}function b(e,n,a,r,o,u,c){return e.filter(t=>!o.skipOptionalParameters||t.required).flatMap(t=>{const i=r[n==="querystring"?"query":n]?.[t.name];if(i!=null)return[{name:t.name,value:String(i)}];const d=t.serverValues?.[a]?.example;if(d!=null)return[{name:t.name,value:T(t,d)}];if(t.example!=null){const s=N(t,n,t.example);return s||(t.serializationMime&&u.serializeParameter?[{name:t.name,value:u.serializeParameter(t,t.example)}]:[{name:t.name,value:T(t,t.example)}])}if(n==="querystring"&&t.serializationMime===k.URL_ENCODED&&t.schemaId){const s=u.resolveSchema(t.schemaId);if(s){const p=u.sampleFromSchema(s,c),m=N(t,n,p);if(m)return m}}return[{name:t.name,value:oe(t,u,c)}]})}function oe(e,n,a){if(e.schemaId){const r=n.resolveSchema(e.schemaId);if(r){const o=n.sampleFromSchema(r,a);if(o!=null)return e.serializationMime&&n.serializeParameter?n.serializeParameter(e,o):T(e,o)}}return`{${e.name}}`}function ie(e){switch(e){case"query":case"querystring":case"cookie":return"form";case"path":case"header":return"simple";default:return"form"}}function T(e,n){if(n==null)return"";if(typeof n!="object")return String(n);const a=e.style??ie(e.in),o=e.explode??a==="form"?"*":"",u="__redoc_param_name__";try{switch(a){case"form":{const l=$.parse(`{?${u}${o}}`).expand({[u]:n}).substring(1).replace(/__redoc_param_name__/g,e.name).split(`&${e.name}=`);return l[0]=l[0].replace(new RegExp(`^${se(e.name)}=`),""),l.map(D).join(",")}case"spaceDelimited":return Array.isArray(n)?n.map(String).join(" "):String(n);case"pipeDelimited":return Array.isArray(n)?n.map(String).join("|"):String(n);case"simple":case"label":case"matrix":{const c=a==="label"?".":a==="matrix"?";":"",t=$.parse(`{${c}${u}${o}}`);return D(t.expand({[u]:n}).replace(/__redoc_param_name__/g,e.name))}case"deepObject":return JSON.stringify(n);default:return JSON.stringify(n)}}catch{return Array.isArray(n)?n.map(String).join(","):JSON.stringify(n)}}function se(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function D(e){try{return decodeURIComponent(e)}catch{return e}}function le(e,n,a,r,o,u,c){let t;if(a.replayBody!==void 0&&(t=a.replayBody),t===void 0&&a.exampleName){const s=Q(e.exampleIds,a.exampleName,r.resolveExample),p=s?r.resolveExample(s):void 0;p&&(t=p.value)}if(t===void 0&&e.exampleIds?.length){const s=r.resolveExample(e.exampleIds[0]);s&&(t=s.value)}if(t===void 0&&e.schemaId){const s=r.resolveVariantSchemaForSampling?.(e.schemaId),p=s?.schema??r.resolveSchema(e.schemaId),m=s?.variantSchemaId??e.schemaId;if(p){const y=n.toLowerCase().includes("xml");t=r.sampleFromSchema(p,{...o,format:y?"xml":o.format}),t&&typeof t=="object"&&!Array.isArray(t)&&m!==e.schemaId&&r.applyDiscriminatorValue?.(t,m)}}if(c!==void 0&&a.replayBody===void 0&&(t===void 0?t=c:t=F(t,c)),t===void 0)return;const l=n.toLowerCase();let i,d=[];if(l.includes("x-www-form-urlencoded"))typeof t=="object"&&t!==null?(d=Object.entries(t).map(([s,p])=>({name:s,value:E(p)})),i=H(t)):i=String(t);else if(l.includes("multipart/form-data"))typeof t=="string"?(d=M(t)??[],i=t):(typeof t=="object"&&t!==null&&!Array.isArray(t)&&(d=Object.entries(t).map(([s,p])=>({name:s,value:E(p)}))),i=JSON.stringify(t,null,2));else if(K(l))if(typeof t=="string")i=t;else{const s=e.schemaId?r.resolveSchema(e.schemaId):void 0;i=String(Y(t,l,s,!0))}else l.includes("json")?i=typeof t=="string"?t:JSON.stringify(t,null,2):l.includes("xml")?i=typeof t=="string"?t:t&&typeof t=="object"?L(t):String(t):i=typeof t=="string"?t:JSON.stringify(t,null,2);return{mimeType:n,params:d,text:i}}function ue(e){try{const n=JSON.parse(e);if(n&&typeof n=="object"&&!Array.isArray(n))return n}catch{}}export{Ie as buildCodeSampleHAR};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const REPLAY_TRY_IT_LOADING_STATE: {
|
|
2
|
+
readonly NOT_LOADED: 'NOT_LOADED';
|
|
3
|
+
readonly LOADING: 'LOADING';
|
|
4
|
+
readonly LOADED: 'LOADED';
|
|
5
|
+
};
|
|
6
|
+
export type ReplayTryItLoadingState = (typeof REPLAY_TRY_IT_LOADING_STATE)[keyof typeof REPLAY_TRY_IT_LOADING_STATE];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{LOADING_STATE as T}from"../../../constants/openapi.js";const _=T;export{_ as REPLAY_TRY_IT_LOADING_STATE};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import{MediaTypes as u}from"../../constants/openapi.js";const A="boundary-separator",y=t=>typeof t=="object"&&t!==null;function d(t){const n=t?.format;return typeof n=="string"?n:void 0}function $(t){const n=t?.contentMediaType;return typeof n=="string"?n:void 0}function T(t){const n=t?.type;return typeof n=="string"?n:void 0}function m(t,n){if(!t)return;const r=t.prefixItems;if(Array.isArray(r)){const o=r[n];if(o&&typeof o=="object")return o}const e=t.items;if(Array.isArray(e)){const o=e[n];return o&&typeof o=="object"?o:void 0}if(e&&typeof e=="object")return e}function N(t,n){const r=t?.properties;if(!r||typeof r!="object")return;const e=r[n];if(!(!e||typeof e!="object"))return e}const I=(t,n)=>{const r=$(n);return r||(d(n)==="binary"?"application/octet-stream":typeof t=="object"&&t!==null?"application/json":"text/plain")},g=t=>{const n=[];if(t.event!==void 0&&n.push(`event: ${t.event}`),t.data!==void 0){const r=t.data;(typeof r=="string"?r:JSON.stringify(r)).split(`
|
|
2
|
+
`).forEach(o=>{n.push(`data: ${o}`)})}return t.id!==void 0&&n.push(`id: ${t.id}`),t.retry!==void 0&&n.push(`retry: ${t.retry}`),n.join(`
|
|
3
|
+
`)},l=(t,n)=>{if(typeof t!="string")return t;const r=d(n);return r==="binary"?"[Binary data]":r==="byte"?"[Base64 encoded data]":t},O=(t,n)=>{if(!n?.properties||typeof n.properties!="object")return t;const r={...t};for(const[e,o]of Object.entries(r)){const a=N(n,e);a&&(r[e]=l(o,a))}return r},v=(t,n,r)=>{const e=[`Content-Type: ${t}`];return r&&e.push(`Content-Transfer-Encoding: ${r}`),[...e,"",n].join(`\r
|
|
4
|
+
`)},j=(t,n)=>n.map(r=>`--${t}\r
|
|
5
|
+
${r}`).join(`\r
|
|
6
|
+
`),J=t=>{if(!t||typeof t!="object"||Array.isArray(t))return!1;const n=Object.keys(t);return n.length===0?!1:n.every(r=>/^\d+$/.test(r))},M=t=>Object.keys(t).map(r=>parseInt(r,10)).sort((r,e)=>r-e).map(r=>t[String(r)]),C=(t,n)=>{const r=[],e=i=>J(i)?M(i):i,o=(i,s)=>{const c=e(i);if(typeof c=="object"&&c!==null){const p=Array.isArray(c)?c.map(f=>typeof f=="object"&&f!==null?O(f,s):l(f,s)):O(c,s);r.push(v("application/json",JSON.stringify(p,null,2)))}else{const p=l(c,s),f=I(p,s),S=d(s),E=S==="binary"?"binary":S==="byte"?"base64":void 0;r.push(v(f,String(p),E))}},a=e(t);return Array.isArray(a)?a.forEach((i,s)=>o(i,m(n,s)??n)):o(a,n),j(A,r)},R=t=>Array.isArray(t)?t.map(n=>g(n)).join(`
|
|
7
|
+
|
|
8
|
+
`):g(t),_=(t,n)=>{const r="0x1E",e="0x0A";return typeof t=="string"?t:T(n)==="array"?`${r}${[JSON.stringify(t)]}${e}`:Array.isArray(t)&&t.length>=1?t.map(o=>`${r}${JSON.stringify(o)}${e}`).join(`
|
|
9
|
+
`):`${r}${JSON.stringify(t)}${e}`},h=(t,n)=>typeof t=="string"?t:T(n)==="array"?`${[JSON.stringify(t)]}`:Array.isArray(t)?t.map(r=>JSON.stringify(r)).join(`
|
|
10
|
+
`):JSON.stringify(t),L={[u.EVENT_STREAM]:{shouldConvert:y,convert:R,lineSeparator:`
|
|
11
|
+
|
|
12
|
+
`},[u.JSON_SEQ]:{shouldConvert:y,convert:_,lineSeparator:`
|
|
13
|
+
`},[u.JSONL]:{shouldConvert:y,convert:h,lineSeparator:`
|
|
14
|
+
`},[u.NDJSON]:{shouldConvert:y,convert:h,lineSeparator:`
|
|
15
|
+
`},[u.MULTIPART_MIXED]:{shouldConvert:t=>t!==null,convert:C,lineSeparator:`\r
|
|
16
|
+
`}};function b(t,n,r,e=!1){const o=L[n];if(o?.shouldConvert(t)){const a=o.convert(t,r);let i;return e?i=Array.from({length:3},()=>a).join(o.lineSeparator):i=a,n===u.MULTIPART_MIXED&&(i=i+`\r
|
|
17
|
+
--${A}--`),i}return t}export{b as convertSampleToString};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { SchemaEntry } from '../../types/store.js';
|
|
2
|
+
export type EffectiveDiscriminator = {
|
|
3
|
+
propertyName: string;
|
|
4
|
+
mapping: Record<string, string>;
|
|
5
|
+
};
|
|
6
|
+
export declare function findEffectiveDiscriminator(schemaData: Record<string, unknown> | undefined, schemaStore: Record<string, SchemaEntry>, visited?: Set<string>): EffectiveDiscriminator | undefined;
|
|
7
|
+
export declare function applyDiscriminatorValue(sample: Record<string, unknown>, variantSchemaId: string, schemaStore: Record<string, SchemaEntry>): void;
|
|
8
|
+
export type SchemaVariantOption = {
|
|
9
|
+
label: string;
|
|
10
|
+
schemaId: string;
|
|
11
|
+
mappingKey?: string;
|
|
12
|
+
isDefaultMapping?: boolean;
|
|
13
|
+
isDeprecated?: boolean;
|
|
14
|
+
};
|
|
15
|
+
export type SchemaVariantAxis = {
|
|
16
|
+
kind: 'discriminator' | 'oneOf' | 'anyOf';
|
|
17
|
+
stateKey: string;
|
|
18
|
+
options: SchemaVariantOption[];
|
|
19
|
+
localPart: string;
|
|
20
|
+
parentPath: string[];
|
|
21
|
+
};
|
|
22
|
+
export declare function collectNestedVariantAxes(schemaData: Record<string, unknown> | undefined, schemaStore: Record<string, SchemaEntry>, out?: Map<string, SchemaVariantAxis>, visitedRefs?: Set<string>, path?: string[]): Map<string, SchemaVariantAxis>;
|
|
23
|
+
export declare function findSchemaVariantAxis(schemaId: string, schemaStore: Record<string, SchemaEntry>, { includeNested }?: {
|
|
24
|
+
includeNested?: boolean;
|
|
25
|
+
}): SchemaVariantAxis | undefined;
|
|
26
|
+
export declare function resolveActiveVariantIndex(axis: SchemaVariantAxis, activeDiscriminator?: Record<string, number>, activeOneOf?: Record<string, number>): number;
|
|
27
|
+
export declare function resolveActiveVariantSchemaId(schemaId: string, schemaStore: Record<string, SchemaEntry>, activeDiscriminator?: Record<string, number>, activeOneOf?: Record<string, number>): string;
|
|
28
|
+
export declare function hoistActiveVariantSchemaForSampling(schemaId: string, schemaStore: Record<string, SchemaEntry>, activeDiscriminator?: Record<string, number>, activeOneOf?: Record<string, number>): {
|
|
29
|
+
schema: Record<string, unknown>;
|
|
30
|
+
variantSchemaId: string;
|
|
31
|
+
} | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Deep-collapse inline nested oneOf/anyOf to the active branch (default 0) so
|
|
34
|
+
* generated samples follow the switcher — and so null branches sample as `null`:
|
|
35
|
+
* the sampler turns any surviving `oneOf: [{type: 'null'}]` wrapper into `{}`.
|
|
36
|
+
* Returns a structural clone.
|
|
37
|
+
*/
|
|
38
|
+
export declare function applyActiveVariantsToSchema(data: Record<string, unknown>, schemaStore: Record<string, SchemaEntry>, activeOneOf?: Record<string, number>, parentPath?: string[]): Record<string, unknown>;
|
|
39
|
+
export declare function applyActiveVariantsToStore(schemaStore: Record<string, SchemaEntry>, activeDiscriminator?: Record<string, number>, activeOneOf?: Record<string, number>): Record<string, Record<string, unknown>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{buildVariantStateKey as L}from"../../jotai/itemStore.js";import{deriveVariantLabel as H}from"../schema/variant-label.js";function A(n){return n.discriminator}function O(n){return n.startsWith("#/")?n.slice(2):n}function m(n,e,i=new Set){if(!n)return;const r=A(n);if(r?.propertyName&&r.mapping)return{propertyName:r.propertyName,mapping:r.mapping};const t=n.allOf;if(Array.isArray(t))for(const o of t){if(!o||typeof o!="object")continue;const f=o;if(typeof f.$ref=="string"){const c=O(f.$ref);if(i.has(c))continue;i.add(c);const s=e[c];if(s){const a=m(s.data,e,i);if(a)return a}continue}const u=m(f,e,i);if(u)return u}}function nn(n,e,i){for(const r of Object.values(i)){const t=A(r.data);if(!(!t?.propertyName||!t.mapping)&&t.propertyName in n){if(t.defaultMapping&&O(t.defaultMapping)===e)return;for(const[o,f]of Object.entries(t.mapping))if(O(f)===e){n[t.propertyName]=o;return}}}}function $({oneOfList:n,oneOfOwner:e,extraSiblings:i,fallbackSchemaId:r,schemaStore:t,activeIdx:o=0}){const f=o>=0&&o<n.length?o:0,u=n[f],c=k(u,t);if(!c)return;const{oneOf:s,anyOf:a,...p}=e,d=[...i,p].filter(j),y=[...Array.isArray(c.allOf)?c.allOf:[],...d],{allOf:T,...x}=c,C=y.length?{...x,allOf:y}:{...x},v=F(u,t)??r;return{schema:C,variantSchemaId:v}}function j(n){return!!n&&typeof n=="object"&&!Array.isArray(n)&&Object.keys(n).length>0}function k(n,e){if(!n||typeof n!="object")return;const i=n;if(typeof i.$ref!="string")return i;const r=O(i.$ref);return e[r]?.data}function F(n,e){if(!n||typeof n!="object")return;const i=n;if(typeof i.$ref!="string")return;const r=O(i.$ref);return e[r]?r:void 0}const W="One of:",P="Any of:",B="Default mapping";function N(n){return!!n?.deprecated}function z(n,e){if(!n||typeof n!="object")return{};const i=n;if(typeof i.$ref=="string"){const r=O(i.$ref),o={...e[r]?.data??{}};return o["x-original-ref"]=i.$ref,o}return i}function D(n,e,i,r){const t=Object.entries(e.mapping);if(t.length===0)return;const o=n.discriminator?.defaultMapping,f=[];for(const[u,c]of t){if(o&&c===o)continue;const s=O(c);f.push({label:u,schemaId:s,mappingKey:u,isDeprecated:N(i[s]?.data)})}if(o){const u=O(o);f.push({label:B,schemaId:u,isDefaultMapping:!0,isDeprecated:N(i[u]?.data)})}return{kind:"discriminator",stateKey:L(r,e.propertyName),options:f,localPart:e.propertyName,parentPath:r}}function g(n,e,i,r,t){if(!n.length)return;const o=t==="anyOf"?P:W,f=[],u=new Map;for(let c=0;c<n.length;c++){const s=n[c],a=z(s,i),{label:p}=H(a,e),d=(u.get(p)??0)+1;u.set(p,d);const l=d===1?p:`${p} (${d})`,y=F(s,i)??"";f.push({label:l,schemaId:y,isDeprecated:N(i[y]?.data??s)})}return{kind:t,stateKey:L(r,o),options:f,localPart:o,parentPath:r}}function _(n,e,i){const r=m(n,e);if(r){const t=D(n,r,e,i);if(t&&t.options.length>0)return t}if(Array.isArray(n.oneOf)&&n.oneOf.length>0){const t=g(n.oneOf,n,e,i,"oneOf");if(t&&t.options.length>0)return t}if(Array.isArray(n.anyOf)&&n.anyOf.length>0){const t=g(n.anyOf,n,e,i,"anyOf");if(t&&t.options.length>0)return t}}function I(n,e,i=new Map,r=new Set,t=[]){if(!n)return i;const o=(c,s=t)=>{if(!c||typeof c!="object")return;const a=c;if(typeof a.$ref=="string"){const d=O(a.$ref);if(r.has(d))return;r.add(d);const l=e[d]?.data;if(!l)return;const y=_(l,e,s);y&&y.options.length>1&&i.set(y.stateKey,y),I(l,e,i,r,s);return}const p=_(a,e,s);p&&p.options.length>1&&i.set(p.stateKey,p),I(a,e,i,r,s)},f=n.properties;if(f&&typeof f=="object")for(const[c,s]of Object.entries(f))o(s,[...t,c]);const u=t.length>0?[...t.slice(0,-1),`${t[t.length-1]}[]`]:t;o(n.items,u);for(const c of["oneOf","anyOf","allOf"]){const s=n[c];if(Array.isArray(s))for(const a of s)o(a,t)}return i}function G(n,e,{includeNested:i=!1}={}){const r=e[n];if(!r)return;const t=_(r.data,e,[]);if(t&&t.options.length>0)return t;if(!i)return;const o=I(r.data,e);if(o.size===1)return o.values().next().value}function b(n,e,i){const r=n.kind==="discriminator"?e:i;if(!r)return 0;const t=r[n.stateKey];if(t!==void 0&&t>=0&&t<n.options.length)return t;const o=Object.entries(r).filter(([f])=>f.endsWith(`/${n.stateKey}`)||f.includes("/")&&n.stateKey.endsWith(`/${f}`));if(o.length===1){const[,f]=o[0];if(f>=0&&f<n.options.length)return f}return 0}function M(n,e,i,r){const t=G(n,e);if(!t)return n;const o=b(t,i,r),f=t.options[o]??t.options[0];return f?.schemaId&&e[f.schemaId]?f.schemaId:n}function tn(n,e,i,r){const t=U(n,e,r);if(t)return t;const o=M(n,e,i,r);if(o!==n){const f=e[o];if(f)return{schema:f.data,variantSchemaId:o}}}function U(n,e,i){const r=e[n];if(!r||A(r.data))return;const t=r.data;if(Array.isArray(t.oneOf)&&t.oneOf.length>0){const o=g(t.oneOf,t,e,[],"oneOf"),f=o?b(o,void 0,i):0;return $({oneOfList:t.oneOf,oneOfOwner:t,extraSiblings:[],fallbackSchemaId:n,schemaStore:e,activeIdx:f})}if(Array.isArray(t.anyOf)&&t.anyOf.length>0){const o=g(t.anyOf,t,e,[],"anyOf"),f=o?b(o,void 0,i):0;return $({oneOfList:t.anyOf,oneOfOwner:t,extraSiblings:[],fallbackSchemaId:n,schemaStore:e,activeIdx:f})}if(Array.isArray(t.allOf)){let o,f,u="oneOf";const c=[];for(const p of t.allOf){const d=k(p,e)??p,l=Array.isArray(d.oneOf)?d.oneOf:Array.isArray(d.anyOf)?d.anyOf:void 0;!f&&l?.length&&!A(d)?(o=d,f=l,u=Array.isArray(d.oneOf)?"oneOf":"anyOf"):c.push(p)}if(!f||!o)return;const s=g(f,o,e,[],u),a=s?b(s,void 0,i):0;return $({oneOfList:f,oneOfOwner:o,extraSiblings:c,fallbackSchemaId:n,schemaStore:e,activeIdx:a})}}function X(n){return n.length===0?n:[...n.slice(0,-1),`${n[n.length-1]}[]`]}function Y(n,e,i,r=[]){const t=(o,f)=>{if(!o||typeof o!="object")return o;if(Array.isArray(o))return o.map(s=>t(s,f));const u=o;if(typeof u.$ref=="string")return u;if(!A(u))for(const s of["oneOf","anyOf"]){const a=u[s];if(!Array.isArray(a)||a.length===0)continue;const p=g(a,u,e,f,s),d=p?b(p,void 0,i):0,l=a[d]??a[0];if(!j(l))continue;const{oneOf:y,anyOf:T,...x}=u;return t({...x,...l},f)}const c={};for(const[s,a]of Object.entries(u))if(s==="properties"&&j(a)){const p={};for(const[d,l]of Object.entries(a))p[d]=t(l,[...f,d]);c[s]=p}else s==="items"?c[s]=t(a,X(f)):s==="allOf"||s==="oneOf"||s==="anyOf"?c[s]=t(a,f):c[s]=a;return c};return t(n,r)}function E(n,e){return n.type!==void 0||e.type===void 0?n:{...n,type:e.type}}function en(n,e,i){const r={};for(const[t,o]of Object.entries(n)){if(!o.data)continue;const f=A(o.data);if(f?.propertyName&&f.mapping){const c=M(t,n,e,i),s=n[c]?.data;if(s&&c!==t){const a=R(s,t,o.data);r[t]=E(q(a,f,c),o.data)}else r[t]=o.data;continue}let u=!1;for(const c of["oneOf","anyOf"]){const s=o.data[c];if(!Array.isArray(s))continue;const a=g(s,o.data,n,[],c);if(!a||a.options.length<=1)continue;const p=b(a,void 0,i),d=a.options[p]??a.options[0];if(!d?.schemaId||!n[d.schemaId])continue;const l=n[d.schemaId].data;r[t]=E(R(l,t,o.data),o.data),u=!0;break}u||(r[t]=o.data)}for(const[t,o]of Object.entries(r))r[t]=Y(o,n,i);return r}const K="#/";function q(n,e,i){const r=J(e,i);if(!r||!e.propertyName)return n;const t={properties:{[e.propertyName]:{enum:[r]}}};return Array.isArray(n.allOf)?{...n,allOf:[...n.allOf,t]}:{allOf:[n,t]}}function J(n,e){if(n.mapping&&!(n.defaultMapping&&O(n.defaultMapping)===e)){for(const[i,r]of Object.entries(n.mapping))if(O(r)===e)return i}}function Q(n){const e=new Set([`${K}${n}`]);return n.startsWith("components/schemas/")?e.add(`${K}${n.replace("components/schemas/","")}`):e.add(`${K}components/schemas/${n}`),Array.from(e)}function Z(n){const{discriminator:e,oneOf:i,anyOf:r,...t}=n;return t}function R(n,e,i){const r=Q(e);if(!V(n,r))return n;const t=Z(i);return w(n,r,t)}function V(n,e){if(!n||typeof n!="object")return!1;if(Array.isArray(n))return n.some(r=>V(r,e));const i=n;if(typeof i.$ref=="string"&&e.includes(i.$ref))return!0;for(const r of Object.values(i))if(V(r,e))return!0;return!1}function w(n,e,i){if(!n||typeof n!="object")return n;if(Array.isArray(n))return n.map(o=>w(o,e,i));const r=n;if(typeof r.$ref=="string"&&e.includes(r.$ref))return{...i};const t={};for(const[o,f]of Object.entries(r))t[o]=w(f,e,i);return t}export{Y as applyActiveVariantsToSchema,en as applyActiveVariantsToStore,nn as applyDiscriminatorValue,I as collectNestedVariantAxes,m as findEffectiveDiscriminator,G as findSchemaVariantAxis,tn as hoistActiveVariantSchemaForSampling,b as resolveActiveVariantIndex,M as resolveActiveVariantSchemaId};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
type ResolveExample = (id: string) => {
|
|
2
|
+
key?: string;
|
|
3
|
+
} | undefined;
|
|
4
|
+
type ResponseCodeExamples = {
|
|
5
|
+
exampleIds?: string[];
|
|
6
|
+
mediaTypeContent?: Record<string, {
|
|
7
|
+
exampleIds?: string[];
|
|
8
|
+
}>;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Resolves an `exampleKey` from a pluggable tag to a store example id.
|
|
12
|
+
* Spec-level keys (e.g. `beta` under `examples:`) never equal the generated
|
|
13
|
+
* store ids (`example_N`), so the lookup goes through the entry's `key`;
|
|
14
|
+
* direct id equality is kept for callers that already hold a store id.
|
|
15
|
+
* Keys are matched across the whole list before falling back to id equality,
|
|
16
|
+
* so an author key that happens to look like a store id can't be shadowed.
|
|
17
|
+
*/
|
|
18
|
+
export declare function findExampleIdByKey(exampleIds: string[] | undefined, key: string | undefined, resolveExample: ResolveExample): string | undefined;
|
|
19
|
+
/** Response code entries whose examples (in any media type) contain `key`. */
|
|
20
|
+
export declare function responseCodesContainingKey<T extends ResponseCodeExamples>(responseCodes: T[] | undefined, key: string | undefined, resolveExample: ResolveExample): T[];
|
|
21
|
+
/** Media type of a request-body map (mediaType → { exampleIds }) whose examples contain `key`. */
|
|
22
|
+
export declare function mediaTypeContainingKey(requestBody: Record<string, {
|
|
23
|
+
exampleIds?: string[];
|
|
24
|
+
}> | undefined, key: string | undefined, resolveExample: ResolveExample): string | undefined;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function r(n,e,i){if(!(!e||!n?.length))return n.find(t=>i(t)?.key===e)??n.find(t=>t===e)}function o(n,e,i){return!e||!n?.length?[]:n.filter(t=>f(t,e,i))}function u(n,e,i){if(!(!e||!n))return Object.keys(n).find(t=>!!r(n[t]?.exampleIds,e,i))}function f(n,e,i){return r(n.exampleIds,e,i)?!0:Object.values(n.mediaTypeContent??{}).some(({exampleIds:t})=>!!r(t,e,i))}export{r as findExampleIdByKey,u as mediaTypeContainingKey,o as responseCodesContainingKey};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CodeSampleHAR } from '../sample-har.js';
|
|
2
|
+
import type { GeneratorOptions } from './types.js';
|
|
3
|
+
type CSharpNewtonsoftOptions = GeneratorOptions & {
|
|
4
|
+
indent?: string;
|
|
5
|
+
withWrapper?: boolean;
|
|
6
|
+
variablesPrefix?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function generateCSharpNewtonsoft(har: CodeSampleHAR, options?: CSharpNewtonsoftOptions): string;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{CodeBuilder as y,Lang as b}from"./helpers/code-builder.js";import{addIndentation as w,buildUrlExpression as T,printUrlVariablesDeclarations as S}from"./helpers/url-helpers.js";import{buildCSharpNewtonsoftDeviceAuthorizationCodeSnippet as A}from"./helpers/oauth2-snippets.js";import{normalizeMimeType as d}from"./helpers/mime.js";import{MediaTypes as a}from"../../../constants/openapi.js";import{stringifyJSObject as O}from"./helpers/stringify-js.js";import{toCodeSampleHAR as v}from"./helpers/sub-request.js";function E(e){return e.charAt(0).toUpperCase()+e.slice(1)}function k(e){return E(e.toLowerCase())}function R(e){return["POST","PUT","DELETE","PATCH"].includes(e.toUpperCase())}function L(e,f){const o={indent:" ",withWrapper:!0,...f},t=new y({indentation:o.indent,variablesPrefix:o.variablesPrefix,capitalize:!0,lang:b.CSHARPNEWTONSOFT}),h=k(e.method),i=e.oAuth2PreRequests?.[0],u=d(e.postData?.mimeType),p=s=>!!(e.postData&&d(e.postData.mimeType)===s),r=()=>!!(e.headersObj&&e.headersObj["Content-Type"]===a.OCTET_STREAM);o.withComments&&(t.push("/*"),t.push(" * Requires >= .NET 5"),t.push(" *"),t.push(' * Requires package "Newtonsoft.Json" >= 9.01'),t.push(" * See here for installation details:"),t.push(" * https://www.newtonsoft.com/json"),t.push(" */"),t.blank()),o.withWrapper&&(t.push("using System;"),t.push("using System.Net.Http;"),t.push("using System.Threading.Tasks;"),(p(a.JSON)||p(a.XML)||e.basicAuth)&&t.push("using System.Text;"),(p(a.URL_ENCODED)||i)&&t.push("using System.Collections.Generic;"),(p(a.JSON)||i)&&t.push("using Newtonsoft.Json.Linq;"),(r()||!e.postData?.params?.length&&e.postData?.text&&u===a.MULTIPART)&&t.push("using System.IO;"),(r()||e.basicAuth)&&t.push("using System.Net.Http.Headers;"),t.blank(),t.push("public class Program"),t.push("{"),t.push(1,"private readonly IHttpClientFactory _httpClientFactory;"),t.push(1,"public static async Task Main(string[] args)"),t.push(1,"{"),t.push(2,"var client = _httpClientFactory.CreateClient();"));const l={...e.allHeaders??e.headersObj};if(i){const s=L(v(i),{...o,withImports:!1,withWrapper:!1,withComments:!1,variablesPrefix:"oauth2"});t.push(s),t.push(2,"var oauth2Response = await oauth2Request.Content.ReadAsStringAsync();"),i.flowType==="deviceAuthorization"?A(t,{tokenUrl:i.tokenUrl??"YOUR_TOKEN_URL",clientId:i.clientId??"YOUR_CLIENT_ID",level:2}):(t.push(2,"JObject inputJObject = JObject.Parse(oauth2Response);"),t.push(2,'var accessToken = inputJObject["access_token"].ToString();'),t.blank())}const c=Object.keys(l).filter(s=>{const n=s.toLowerCase();return n!=="content-type"&&n!=="content-length"&&n!=="accept-encoding"});if(c.length)for(const s of c){const n=s.toLowerCase()==="authorization";t.push(2,'client.DefaultRequestHeaders.Add("%s", %s);',s,i&&n?'"Bearer " + accessToken':`"${l[s]}"`)}if(e.basicAuth){const{username:s,password:n}=e.basicAuth;t.push(2,`var base64String = Convert.ToBase64String(Encoding.ASCII.GetBytes("${s}:${n}"));`),t.push(2,'client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(@"Basic", base64String);')}if(e.postData)switch(u){case a.URL_ENCODED:if(e.postData.params?.length){t.blank(),t.push(2,"List<KeyValuePair<string, string>> postData = new List<KeyValuePair<string, string>>();");for(const s of e.postData.params)t.push(2,'postData.Add(new KeyValuePair<string, string>("%s", "%s"));',s.name,s.value??"");t.blank()}else e.postData.text&&(t.blank(),t.push(3,'var postData = "%s";',e.postData.text));break;case a.MULTIPART:if(e.postData.params&&e.postData.params.length>0){t.blank(),t.push(2,"MultipartFormDataContent postData = new MultipartFormDataContent();");for(const s of e.postData.params)s.fileName?t.push(2,'postData.Add(new ByteArrayContent(File.ReadAllBytes("%s")), "%s", "%s");',s.fileName,s.name,s.fileName):t.push(2,'postData.Add(new StringContent("%s"), "%s");',s.value??"",s.name)}else if(e.postData.text){t.blank();const s=e.postData.text.replace(/\\/g,"\\\\").replace(/"/g,'\\"');t.push(2,'var postData = new StringContent("%s");',s)}break;case a.JSON:if(e.jsonObj){const s=O(e.jsonObj,{indent:o.indent,inlineCharacterLimit:25}).replace(/"/g,'""');t.push(2,`JObject json = JObject.Parse(@"${w(s,{level:3,firstLine:!1})}");`),t.push(2,'var postData = new StringContent(json.ToString(), Encoding.UTF8, "%s");',e.postData.mimeType??a.JSON)}break;case a.XML:e.postData.text&&(e.postData.text.trim().split(`
|
|
2
|
+
`).forEach((n,m)=>{const C=(m===0?'string xml = @"':"")+n.replace(/"/g,'""');t.push(m===0?3:4,C)}),t.push(2,'";'),t.push(2,'var postData = new StringContent(xml, Encoding.UTF8, "%s");',e.postData.mimeType??a.XML));break;case a.OCTET_STREAM:e.postData.text&&(t.push(2,'byte[] bytes = Convert.FromBase64String("%s");',e.postData.text),t.push(2,"var postData = new ByteArrayContent(bytes);"),t.push(2,'postData.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream");'));break}else r()&&(t.push(2,"var ms = new MemoryStream();"),t.push(2,"var postData = new StreamContent(ms);"),t.push(2,'postData.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream");'));S(e,t,3);const D=T(e,t),g=o.withImports?R(e.method)?u===a.URL_ENCODED?", new FormUrlEncodedContent(postData)":e.method.toLowerCase()==="delete"?"":e.postData&&e.postData.params||r()?", postData":", null":"":", new FormUrlEncodedContent(postData)";return t.push(2,"var %s = await client.%sAsync(%s%s);",t.var("request"),h,D,g),o.withWrapper&&(t.push(2,"var response = await request.Content.ReadAsStringAsync();"),t.blank(),t.push(2,"Console.WriteLine(response);"),t.push(1,"}"),t.push("}")),t.join()}export{L as generateCSharpNewtonsoft};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CodeSampleHAR } from '../sample-har.js';
|
|
2
|
+
import type { GeneratorOptions } from './types.js';
|
|
3
|
+
type CSharpOptions = GeneratorOptions & {
|
|
4
|
+
indent?: string;
|
|
5
|
+
withWrapper?: boolean;
|
|
6
|
+
variablesPrefix?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function generateCSharp(har: CodeSampleHAR, options?: CSharpOptions): string;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{CodeBuilder as E,Lang as k}from"./helpers/code-builder.js";import{buildUrlExpression as R,printUrlVariablesDeclarations as H}from"./helpers/url-helpers.js";import{buildCSharpDeviceAuthorizationCodeSnippet as j}from"./helpers/oauth2-snippets.js";import{normalizeMimeType as C}from"./helpers/mime.js";import{MediaTypes as n}from"../../../constants/openapi.js";import{toCodeSampleHAR as x}from"./helpers/sub-request.js";function L(e){return e.charAt(0).toUpperCase()+e.slice(1)}function M(e){return L(e.toLowerCase())}function U(e){return["POST","PUT","DELETE","PATCH"].includes(e.toUpperCase())}function f(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function N(e){return f(e)&&Object.keys(e).length===0}function P(e,T){const r={indent:" ",withWrapper:!0,...T},t=new E({indentation:r.indent,variablesPrefix:r.variablesPrefix,capitalize:!0,lang:k.CSHARP}),w=M(e.method),p=e.oAuth2PreRequests?.[0],m=C(e.postData?.mimeType),l=s=>!!(e.postData&&C(e.postData.mimeType)===s),c=()=>!!(e.headersObj&&e.headersObj["Content-Type"]===n.OCTET_STREAM);r.withComments&&(t.push("// Requires >= .NET 5"),t.blank()),r.withWrapper&&(t.push("using System;"),t.push("using System.Net.Http;"),t.push("using System.Threading.Tasks;"),(l(n.JSON)||l(n.XML)||e.basicAuth)&&t.push("using System.Text;"),(l(n.URL_ENCODED)||p)&&t.push("using System.Collections.Generic;"),(l(n.JSON)||p)&&t.push("using System.Text.Json;"),(c()||!e.postData?.params?.length&&e.postData?.text&&m===n.MULTIPART)&&t.push("using System.IO;"),(c()||e.basicAuth)&&t.push("using System.Net.Http.Headers;"),t.blank(),t.push("public class Program"),t.push("{"),t.push(1,"public static async Task Main()"),t.push(1,"{"));const g={...e.allHeaders??e.headersObj};if(p){const s=P(x(p),{...r,withImports:!1,withWrapper:!1,withComments:!1,variablesPrefix:"oauth2"});t.push(s),t.push(2,"var oauth2Response = await oauth2Request.Content.ReadAsStringAsync();"),p.flowType==="deviceAuthorization"?j(t,{tokenUrl:p.tokenUrl??"YOUR_TOKEN_URL",clientId:p.clientId??"YOUR_CLIENT_ID",level:2}):(t.push(2,"JObject inputJObject = JObject.Parse(oauth2Response);"),t.push(2,'var accessToken = inputJObject["access_token"].ToString();'),t.blank())}const D=Object.keys(g).filter(s=>{const a=s.toLowerCase();return a!=="content-type"&&a!=="content-length"&&a!=="accept-encoding"});if(D.length){t.push(2,"System.Net.Http.HttpClient client = new()"),t.push(2,"{"),t.push(3,"DefaultRequestHeaders ="),t.push(3,"{");for(const s of D){const a=s.toLowerCase()==="authorization";t.push(4,'{"%s", %s},',s,p&&a?'"Bearer " + accessToken':`"${g[s]}"`)}t.push(3,"}"),t.push(2,"};")}else t.push(2,"System.Net.Http.HttpClient client = new();");if(t.blank(),e.basicAuth){const{username:s,password:a}=e.basicAuth;t.push(2,`string base64String = Convert.ToBase64String(Encoding.ASCII.GetBytes("${s}:${a}"));`),t.push(2,'client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(@"Basic", base64String);'),t.blank()}const y=(s,a)=>{s.forEach((o,u)=>{const i=u<s.length-1;Array.isArray(o)?y(o,a+1):f(o)?(t.push(a+1,"new {"),h(o,a+2),t.push(a+1,"}%s",i?",":"")):t.push(a+1,'"%s"%s',String(o),i?",":"")}),t.push(a,"},")},h=(s,a)=>{const o=Object.entries(s);o.forEach(([u,i],O)=>{const d=O<o.length-1;if(Array.isArray(i))t.push(a,"%s = new[] {",u),y(i,a);else if(f(i)){const b=N(i);t.push(a,"%s = new %s",u,b?"{},":"{"),b||(h(i,a+1),t.push(a,"}%s",d?",":""))}else t.push(a,'%s = "%s"%s',u,String(i),d?",":"")})};if(e.postData)switch(m){case n.URL_ENCODED:if(e.postData.params?.length){t.blank(),t.push(2,"List<KeyValuePair<string, string>> postData = new List<KeyValuePair<string, string>>();");for(const s of e.postData.params)t.push(2,'postData.Add(new KeyValuePair<string, string>("%s", "%s"));',s.name,s.value??"");t.blank()}else e.postData.text&&(t.blank(),t.push(3,'var postData = "%s";',e.postData.text));break;case n.MULTIPART:if(e.postData.params&&e.postData.params.length>0){t.blank(),t.push(2,"MultipartFormDataContent postData = new MultipartFormDataContent();");for(const s of e.postData.params)s.fileName?t.push(2,'postData.Add(new ByteArrayContent(File.ReadAllBytes("%s")), "%s", "%s");',s.fileName,s.name,s.fileName):t.push(2,'postData.Add(new StringContent("%s"), "%s");',s.value??"",s.name)}else if(e.postData.text){t.blank();const s=e.postData.text.replace(/\\/g,"\\\\").replace(/"/g,'\\"');t.push(2,'var postData = new StringContent("%s");',s)}break;case n.JSON:e.jsonObj&&(t.push(2,"string json = JsonSerializer.Serialize(new"),t.push(2,"{"),h(e.jsonObj,3),t.push(2,"});"),t.blank(),t.push(2,'using StringContent postData = new(json, Encoding.UTF8, "%s");',e.postData.mimeType??n.JSON));break;case n.XML:e.postData.text&&(e.postData.text.trim().split(`
|
|
2
|
+
`).forEach((a,o)=>{const u=(o===0?'string xml = @"':"")+a.replace(/"/g,'""');t.push(o===0?2:3,u)}),t.push(2,'";'),t.push(2,'using StringContent postData = new StringContent(xml, Encoding.UTF8, "%s");',e.postData.mimeType??n.XML));break;case n.OCTET_STREAM:e.postData.text&&(t.push(2,'byte[] bytes = Convert.FromBase64String("%s");',e.postData.text),t.push(2,"var postData = new ByteArrayContent(bytes);"),t.push(2,'postData.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream");'));break}else c()&&(t.push(2,"var ms = new MemoryStream();"),t.push(2,"var postData = new StreamContent(ms);"),t.push(2,'postData.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream");'));H(e,t,3);const S=R(e,t),A=r.withImports?U(e.method)?m===n.URL_ENCODED?", new FormUrlEncodedContent(postData)":e.method.toLowerCase()==="delete"?"":e.postData&&e.postData.params||c()?", postData":", null":"":", new FormUrlEncodedContent(postData)";return t.push(2,"using HttpResponseMessage %s = await client.%sAsync(%s%s);",t.var("request"),w,S,A),r.withWrapper&&(t.push(2,"string response = await request.Content.ReadAsStringAsync();"),t.blank(),t.push(2,"Console.WriteLine(response);"),t.push(1,"}"),t.push("}")),t.join()}export{P as generateCSharp};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CodeSampleHAR } from '../sample-har.js';
|
|
2
|
+
import type { GeneratorOptions } from './types.js';
|
|
3
|
+
type CurlOptions = GeneratorOptions & {
|
|
4
|
+
indent?: string;
|
|
5
|
+
binary?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare function generateCurl(har: CodeSampleHAR, options?: CurlOptions): string;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{CodeBuilder as D,Lang as q}from"./helpers/code-builder.js";import{buildUrlExpression as y,addIndentation as m}from"./helpers/url-helpers.js";import{buildShellDeviceAuthorizationCodeSnippet as R}from"./helpers/oauth2-snippets.js";import{shellHelpers as o}from"./helpers/shell.js";import{normalizeMimeType as T}from"./helpers/mime.js";import{MediaTypes as d}from"../../../constants/openapi.js";import{toCodeSampleHAR as v}from"./helpers/sub-request.js";function x(e,C){const f={indent:" ",short:!1,binary:!1,withComments:!1,...C},{indent:a,short:n,binary:O}=f,t=new D({indentation:a,lineJoin:a?` \\
|
|
2
|
+
`+a:" ",lang:q.CURL}),u=e.oAuth2PreRequests?.[0];let r="",c="";if(u&&(r=x(v(u),{...f,withComments:!1}),u.flowType==="deviceAuthorization")){r="OAUTH2_RESPONSE=$("+r.replace(/^curl -i/,"curl -s")+")";const l=new D({indentation:a,lang:q.CURL});R(l,{tokenUrl:u.tokenUrl??"YOUR_TOKEN_URL",clientId:u.clientId??"YOUR_CLIENT_ID",level:0,short:n}),c=l.join()}t.push(0,"curl -i %s %s",n?"-X":"--request",e.method.toUpperCase()),e.basicAuth&&t.push("-u %s",o.quote(`${e.basicAuth.username}:${e.basicAuth.password}`));const b=y(e,t);t.push("%s%s",n?"":"--url ",o.quote(b)),e.httpVersion==="HTTP/1.0"&&t.push(n?"-0":"--http1.0");const h=Object.keys(e.headersObj).sort();for(const l of h){let i=e.headersObj[l];u?.flowType==="deviceAuthorization"&&l.toLowerCase()==="authorization"&&i==="Bearer <YOUR_TOKEN_HERE>"&&(i="Bearer $ACCESS_TOKEN");const s=`${l}: ${i}`;t.push("%s %s",n?"-H":"--header",o.quote(s))}if(e.allHeaders.cookie&&t.push("%s %s",n?"-b":"--cookie",o.quote(e.allHeaders.cookie)),e.postData){const l=T(e.postData.mimeType),i=O?"--data-binary":n?"-d":"--data";switch(l){case d.MULTIPART:if(e.postData.params&&e.postData.params.length>0)for(const s of e.postData.params){const A=s.fileName?`${s.name}=@${s.fileName}`:`${s.name}=${s.value??""}`;t.push("%s %s",n?"-F":"--form",o.quote(A))}else e.postData.text&&t.push("%s %s",i,o.quote(e.postData.text));break;case d.URL_ENCODED:if(e.postData.params&&e.postData.params.length>0)for(const s of e.postData.params)t.push("%s %s",i,o.quote(`${s.name}=${s.value??""}`));else e.postData.text&&t.push("%s %s",i,o.quote(e.postData.text));break;case d.JSON:{const s=e.jsonObj??U(e.postData.text);s!=null?t.push("%s %s",i,m(o.quote(JSON.stringify(s,null,a)),{level:1,indent:a,firstLine:!1})):e.postData.text&&e.postData.text!=="null"&&t.push("%s %s",i,m(o.quote(e.postData.text),{level:1,indent:a,firstLine:!1}));break}default:e.postData.text&&t.push("%s %s",i,m(o.quote(e.postData.text),{level:1,indent:a,firstLine:!1}))}}let p="";return f.withComments&&(p=`# Requires curl >= 7.2
|
|
3
|
+
`,u?.flowType==="deviceAuthorization"&&(p+=`# Requires jq for JSON parsing
|
|
4
|
+
`),p+=`
|
|
5
|
+
`),p+(r?r+`
|
|
6
|
+
`:"")+(c?c+`
|
|
7
|
+
`:"")+t.join()}function U(e){if(e)try{return JSON.parse(e)}catch{return}}export{x as generateCurl};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CodeSampleHAR } from '../sample-har.js';
|
|
2
|
+
import type { GeneratorOptions } from './types.js';
|
|
3
|
+
type GoOptions = GeneratorOptions & {
|
|
4
|
+
indent?: string;
|
|
5
|
+
capitalize?: boolean;
|
|
6
|
+
showBoilerplate?: boolean;
|
|
7
|
+
checkErrors?: boolean;
|
|
8
|
+
printBody?: boolean;
|
|
9
|
+
timeout?: number;
|
|
10
|
+
variablesPrefix?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare function generateGo(har: CodeSampleHAR, options?: GoOptions): string;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{CodeBuilder as b,Lang as D}from"./helpers/code-builder.js";import{buildUrlExpression as $,printUrlVariablesDeclarations as q}from"./helpers/url-helpers.js";import{buildGoDeviceAuthorizationCodeSnippet as w}from"./helpers/oauth2-snippets.js";import{normalizeMimeType as m}from"./helpers/mime.js";import{MediaTypes as p}from"../../../constants/openapi.js";import{toCodeSampleHAR as N}from"./helpers/sub-request.js";const t=1;function k(s){if(s.jsonObj!==void 0)return s.jsonObj;if(s.postData?.text)try{return JSON.parse(s.postData.text)}catch{}return{}}function h(s,f){return m(s?.mimeType)===f}function R(s,f){const a={capitalize:!0,showBoilerplate:!0,checkErrors:!0,printBody:!0,timeout:-1,indent:" ",...f},n=s.oAuth2PreRequests?.[0],i=a.checkErrors?"err":"_",d=s.method.toUpperCase();let v="http.DefaultClient";const e=new b({indentation:a.indent,variablesPrefix:a.variablesPrefix,capitalize:a.capitalize,lang:D.GO}),c=()=>{a.checkErrors&&e.push(t,"if err != nil {").push(t+1,"panic(err)").push(t,"}")};a.showBoilerplate&&(e.push("package main").blank().push("import (").push(t,'"fmt"'),(a.timeout>0||n?.flowType==="deviceAuthorization")&&e.push(t,'"time"'),n&&e.push(t,'"encoding/json"'),h(s.postData,p.MULTIPART)&&(e.push(t,'"mime/multipart"'),e.push(t,'"io"'),e.push(t,'"bytes"')),(h(s.postData,p.URL_ENCODED)||h(n?.postData,p.URL_ENCODED))&&(e.push(t,'"net/url"'),e.push(t,'"strconv"')),(h(s.postData,p.JSON)||h(n?.postData,p.JSON))&&e.push(t,'"bytes"'),(s.postData&&!h(s.postData,p.JSON)||n)&&e.push(t,'"strings"'),e.push(t,'"net/http"'),a.printBody&&e.push(t,'"io/ioutil"'),e.push(")").blank().push("func main() {"));const u={};for(const[r,o]of Object.entries(s.allHeaders??s.headersObj??{}))u[r]=`"${o}"`;if(n){const r="oAuth2",o=a.checkErrors?`${i} := `:"",l=a.capitalize?"Res":"res",y=R(N(n),{...a,printBody:!1,variablesPrefix:r,showBoilerplate:!1});e.push(y).blank(),n.flowType==="deviceAuthorization"?(e.push(t,`var ${r}${l}Body struct {`).push(t+1,"Device_code string").push(t+1,"Interval int64").push(t+1,"Expires_in int64").push(t,"}").push(t,`${o}json.NewDecoder(${r}${l}.Body).Decode(&${r}${l}Body)`).blank(),c(),w(e,{tokenUrl:n.tokenUrl??"YOUR_TOKEN_URL",clientId:n.clientId??"YOUR_CLIENT_ID",level:t}),u.Authorization='"Bearer " + accessToken'):(e.push(t,`var ${r}${l}Body struct {`).push(t+1,"Access_token string").push(t,"}").push(t,`${o}json.NewDecoder(${r}${l}.Body).Decode(&${r}${l}Body)`).blank(),c(),u.Authorization=`"Bearer " + ${r}${l}Body.Access_token`)}if(q(s,e,t),a.timeout>0&&(v=e.var("client"),e.push(t,"%s := http.Client{",v).push(t+1,"Timeout: time.Duration(%s * time.Second),",a.timeout).push(t,"}").blank()),e.push(t,`${e.var("reqUrl")} := ${$(s,e)}`),s.postData)switch(m(s.postData.mimeType)){case p.URL_ENCODED:if(s.postData.params?.length){e.push(t,"%s := url.Values{}",e.var("data"));for(const r of s.postData.params)e.push(t,'%s.Set("%s", "%s")',e.var("data"),r.name,r.value);e.push(t,'%s, %s := http.NewRequest("%s", %s, strings.NewReader(%s.Encode()))',e.var("req"),i,d,e.var("reqUrl"),e.var("data")),u["Content-Length"]=`strconv.Itoa(len(${e.var("data")}.Encode()))`}else s.postData.text&&(e.push(t,'%s := "%s"',e.var("data"),s.postData.text),e.push(t,'%s, %s := http.NewRequest("%s", %s, strings.NewReader(%s))',e.var("req"),i,d,e.var("reqUrl"),e.var("data")),u["Content-Length"]=`strconv.Itoa(len(${e.var("data")}))`);break;case p.JSON:{const r=JSON.stringify(k(s),null,2).split(`
|
|
2
|
+
`).map(o=>a.indent+o).join(`
|
|
3
|
+
`).trim();e.push(t,`var ${e.var("data")} = []byte(\`${r}\`)`),e.push(t,'%s, %s := http.NewRequest("%s", %s, bytes.NewBuffer(%s))',e.var("req"),i,d,e.var("reqUrl"),e.var("data"));break}case p.MULTIPART:if(e.push(t,"%s := &bytes.Buffer{}",e.var("data")).push(t,"writer := multipart.NewWriter(%s)",e.var("data")),s.postData.params&&s.postData.params.length>0)for(const r of s.postData.params){if(!r.fileName&&!r.contentType){e.push(t,'%s, _ := writer.CreateFormField("%s")',e.var(`${r.name}Fw`),r.name).push(t,'_, %s = io.Copy(%s, strings.NewReader("%s"))',i,e.var(`${r.name}Fw`),r.value??""),c();continue}r.fileName&&(e.push(t,'%s, %s = writer.CreateFormFile("%s", "%s")',e.var(`${r.name}Fw`),i,r.name,r.fileName),c())}else if(s.postData.text){e.push(t,"%s := strings.NewReader(%s)",e.var("payload"),JSON.stringify(s.postData.text)).push(t,'%s, %s := http.NewRequest("%s", %s, %s)',e.var("req"),i,d,e.var("reqUrl"),e.var("payload"));break}e.push(t,"writer.Close()").blank().push(t,"%s := bytes.NewReader(%s.Bytes())",e.var("payload"),e.var("data")).push(t,'%s, %s := http.NewRequest("%s", %s, %s)',e.var("req"),i,d,e.var("reqUrl"),e.var("payload")),u["Content-Type"]="writer.FormDataContentType()";break;default:s.postData.text&&e.push(t,"%s := strings.NewReader(%s)",e.var("payload"),JSON.stringify(s.postData.text)).push(t,'%s, %s := http.NewRequest("%s", %s, %s)',e.var("req"),i,d,e.var("reqUrl"),e.var("payload"))}else e.push(t,'%s, %s := http.NewRequest("%s", %s, nil)',e.var("req"),i,d,e.var("reqUrl"));if(Object.keys(s.queryObj??{}).length>0){e.blank().push(t,`${e.var("query")} := ${e.var("req")}.URL.Query()`);for(const r in s.queryObj){const o=s.queryObj[r],y=typeof o=="string"&&/^\[.*\]$/.test(o)?`\`${o}\``:`"${o}"`;e.push(t,`${e.var("query")}.Add("${r}", ${y})`)}e.push(t,`${e.var("req")}.URL.RawQuery = ${e.var("query")}.Encode()`).blank()}if(c(),s.basicAuth){const{username:r,password:o}=s.basicAuth;e.push(t,`%s.SetBasicAuth("${r}", "${o}")`,e.var("req"))}for(const r of Object.keys(u))e.push(t,'%s.Header.Add("%s", %s)',e.var("req"),r,u[r]);return e.push(t,"%s, %s := %s.Do(%s)",e.var("res"),i,v,e.var("req")),c(),a.printBody&&(e.push(t,"defer %s.Body.Close()",e.var("res")).push(t,"%s, %s := ioutil.ReadAll(%s.Body)",e.var("body"),i,e.var("res")),c()),e.blank().push(t,"fmt.Println(%s)",e.var("res")),a.printBody&&e.push(t,"fmt.Println(string(%s))",e.var("body")),a.showBoilerplate&&e.push("}"),e.join()}export{R as generateGo};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export declare const Lang: {
|
|
2
|
+
readonly NODEJS: 'Node.js';
|
|
3
|
+
readonly JAVASCRIPT: 'javascript';
|
|
4
|
+
readonly PYTHON: 'Python';
|
|
5
|
+
readonly JAVA8: 'Java8+Apache';
|
|
6
|
+
readonly JAVA: 'Java';
|
|
7
|
+
readonly CSHARP: 'C#';
|
|
8
|
+
readonly CSHARPNEWTONSOFT: 'C#+Newtonsoft';
|
|
9
|
+
readonly CURL: 'curl';
|
|
10
|
+
readonly GO: 'Go';
|
|
11
|
+
readonly PHP: 'PHP';
|
|
12
|
+
readonly RUBY: 'Ruby';
|
|
13
|
+
readonly R: 'R';
|
|
14
|
+
};
|
|
15
|
+
export type Lang = (typeof Lang)[keyof typeof Lang];
|
|
16
|
+
export declare const VariableType: {
|
|
17
|
+
readonly IMPORT: 'import';
|
|
18
|
+
readonly CUSTOM: 'custom';
|
|
19
|
+
readonly PATH: 'path';
|
|
20
|
+
};
|
|
21
|
+
export type VariableType = (typeof VariableType)[keyof typeof VariableType];
|
|
22
|
+
interface VariableDeclarationOptions {
|
|
23
|
+
hasVariableInterpolation: boolean;
|
|
24
|
+
}
|
|
25
|
+
export type LangOptions = {
|
|
26
|
+
stringLiteral: (t: string) => string;
|
|
27
|
+
variableWrapperFn: (name: string, value?: string | unknown) => string;
|
|
28
|
+
variableDeclaration: (v: string, options?: VariableDeclarationOptions) => string;
|
|
29
|
+
joinSymbol: string;
|
|
30
|
+
urlFieldName: string;
|
|
31
|
+
rawName: boolean;
|
|
32
|
+
};
|
|
33
|
+
export declare class CodeBuilder {
|
|
34
|
+
private code;
|
|
35
|
+
private indentation;
|
|
36
|
+
private variablesPrefix;
|
|
37
|
+
private lineJoin;
|
|
38
|
+
private capitalize;
|
|
39
|
+
private lang;
|
|
40
|
+
langOptions: LangOptions;
|
|
41
|
+
constructor({ indentation, lineJoin, variablesPrefix, capitalize, lang, }: {
|
|
42
|
+
indentation: string;
|
|
43
|
+
lineJoin?: string;
|
|
44
|
+
variablesPrefix?: string;
|
|
45
|
+
capitalize?: boolean;
|
|
46
|
+
lang?: string;
|
|
47
|
+
});
|
|
48
|
+
buildLine(indentationLevel: number | string, line: string): string | null;
|
|
49
|
+
unshift(...args: unknown[]): CodeBuilder;
|
|
50
|
+
push(...args: unknown[]): CodeBuilder;
|
|
51
|
+
blank(): CodeBuilder;
|
|
52
|
+
join(): string;
|
|
53
|
+
clean(): void;
|
|
54
|
+
var(name: string, type?: VariableType): string;
|
|
55
|
+
}
|
|
56
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{camelCase as p,snakeCase as A,pascalCase as o}from"./string-utils.js";function S(a,...e){let l=0;return a.replace(/%s/g,()=>l<e.length?String(e[l++]):"%s")}const i={NODEJS:"Node.js",JAVASCRIPT:"javascript",PYTHON:"Python",JAVA8:"Java8+Apache",JAVA:"Java",CSHARP:"C#",CSHARPNEWTONSOFT:"C#+Newtonsoft",CURL:"curl",GO:"Go",PHP:"PHP",RUBY:"Ruby",R:"R"},c={IMPORT:"import",CUSTOM:"custom",PATH:"path"},r={UNDERSCORES:"under_scores",CAMEL:"camelCase",PASCAL:"PascalCase"},h={[i.NODEJS]:r.CAMEL,[i.JAVASCRIPT]:r.CAMEL,[i.PYTHON]:r.UNDERSCORES,[i.JAVA8]:r.CAMEL,[i.JAVA]:r.CAMEL,[i.CSHARP]:r.PASCAL,[i.CSHARPNEWTONSOFT]:r.PASCAL,[i.CURL]:r.CAMEL,[i.GO]:r.CAMEL,[i.PHP]:r.CAMEL,[i.RUBY]:r.UNDERSCORES,[i.R]:r.UNDERSCORES},u={default:{joinSymbol:"",variableWrapperFn:a=>a,stringLiteral:a=>a,variableDeclaration:a=>a,urlFieldName:"url",rawName:!1},[i.CSHARP]:{joinSymbol:" + ",stringLiteral:a=>`"${a}"`,variableDeclaration:a=>`var ${a} = %s;`,urlFieldName:"fullUrl"},[i.CSHARPNEWTONSOFT]:{joinSymbol:" + ",stringLiteral:a=>`"${a}"`,variableDeclaration:a=>`var ${a} = %s;`,urlFieldName:"fullUrl"},[i.GO]:{joinSymbol:" + ",stringLiteral:a=>`"${a}"`,variableDeclaration:a=>`${a} := %s;`},[i.JAVA]:{joinSymbol:" + ",stringLiteral:a=>`"${a}"`,variableDeclaration:a=>`var ${a} = %s;`,urlFieldName:"pathname"},[i.JAVA8]:{joinSymbol:" + ",stringLiteral:a=>`"${a}"`,variableDeclaration:a=>`String ${a} = %s;`,urlFieldName:"fullUrl"},[i.JAVASCRIPT]:{variableWrapperFn:a=>"${"+a+"}",variableDeclaration:(a,e)=>`const ${a} = ${e?.hasVariableInterpolation?"`%s`":"'%s'"};`},[i.NODEJS]:{variableWrapperFn:a=>"${"+a+"}",variableDeclaration:(a,e)=>`const ${a} = ${e?.hasVariableInterpolation?"`%s`":"'%s'"};`},[i.PHP]:{joinSymbol:" . ",stringLiteral:a=>`"${a}"`,variableDeclaration:a=>`const ${a} = %s;`},[i.PYTHON]:{stringLiteral:a=>`"${a}"`,joinSymbol:" + ",variableDeclaration:a=>`${a} = %s`},[i.RUBY]:{joinSymbol:" + ",stringLiteral:a=>`'${a}'`,variableDeclaration:a=>`${a} = %s`},[i.CURL]:{variableWrapperFn:(a,e)=>e!=null&&e!==""?String(e):`{${a}}`,urlFieldName:"fullUrl",rawName:!0},[i.R]:{joinSymbol:" %&% ",variableDeclaration:a=>`${a} = %s`,urlFieldName:"fullUrl",stringLiteral:a=>`"${a}"`,variableWrapperFn:a=>`${a}`}},C=new Set(["response","request","requests","data","url","payload","main","accessToken","resp","Program","client","postData","App","httpClient","params","pathname","host","body","fetch","query"]);class P{code=[];indentation;variablesPrefix;lineJoin;capitalize;lang;langOptions;constructor({indentation:e,lineJoin:l=`
|
|
2
|
+
`,variablesPrefix:t="",capitalize:n=!1,lang:s=i.CURL}){this.indentation=e,this.variablesPrefix=t,this.lineJoin=l||`
|
|
3
|
+
`,this.capitalize=n,this.lang=s,this.langOptions={...u.default,...u[s]}}buildLine(e,l){let t="",n=2;if(typeof e=="string")n=1,l=e,e=0;else if(e===null)return null;for(;e;)t+=this.indentation,e--;const s=Array.prototype.slice.call(arguments,n,arguments.length);return S(t+l,...s)}unshift(...e){return this.code.unshift(this.buildLine(...e)),this}push(...e){return this.code.push(this.buildLine(...e)),this}blank(){return this.code.push(null),this}join(){return this.code.join(this.lineJoin)}clean(){this.code.splice(1)}var(e,l=c.CUSTOM){if(l===c.PATH){let t=this.variablesPrefix+e;switch(C.has(t)&&(t=`${t}_path`),h[this.lang]){case r.UNDERSCORES:return A(t);case r.PASCAL:return o(t);case r.CAMEL:default:return p(t)}}return this.variablesPrefix?this.variablesPrefix+(this.capitalize?o(e):e):e}}export{P as CodeBuilder,i as Lang,c as VariableType};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function normalizeMimeType(raw?: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function r(e){return e?e.split(";")[0].trim().toLowerCase():""}export{r as normalizeMimeType};
|