@mintlify/msft-sdk 1.1.23 → 1.1.24
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/dist/api-playground/ApiPlayground/Request/BodySection.js +65 -0
- package/dist/api-playground/ApiPlayground/Request/BodySection.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Request/ParameterSection.js +33 -0
- package/dist/api-playground/ApiPlayground/Request/ParameterSection.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Request/PlaygroundModal.js +201 -0
- package/dist/api-playground/ApiPlayground/Request/PlaygroundModal.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Request/SecuritySection.js +147 -0
- package/dist/api-playground/ApiPlayground/Request/SecuritySection.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Request/ServerSection.js +31 -0
- package/dist/api-playground/ApiPlayground/Request/ServerSection.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Request/index.js +44 -0
- package/dist/api-playground/ApiPlayground/Request/index.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Request/inputs/ArrayInput.js +94 -0
- package/dist/api-playground/ApiPlayground/Request/inputs/ArrayInput.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Request/inputs/DifferentiatedInput.js +91 -0
- package/dist/api-playground/ApiPlayground/Request/inputs/DifferentiatedInput.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Request/inputs/FileInput.js +63 -0
- package/dist/api-playground/ApiPlayground/Request/inputs/FileInput.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Request/inputs/NullInput.js +34 -0
- package/dist/api-playground/ApiPlayground/Request/inputs/NullInput.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Request/inputs/NumberInput.js +62 -0
- package/dist/api-playground/ApiPlayground/Request/inputs/NumberInput.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Request/inputs/ObjectChildren.js +110 -0
- package/dist/api-playground/ApiPlayground/Request/inputs/ObjectChildren.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Request/inputs/ObjectInput.js +88 -0
- package/dist/api-playground/ApiPlayground/Request/inputs/ObjectInput.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Request/inputs/RecursiveInput.js +62 -0
- package/dist/api-playground/ApiPlayground/Request/inputs/RecursiveInput.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Request/inputs/SelectInput.js +55 -0
- package/dist/api-playground/ApiPlayground/Request/inputs/SelectInput.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Request/inputs/StringInput.js +68 -0
- package/dist/api-playground/ApiPlayground/Request/inputs/StringInput.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Request/inputs/TextInput.js +45 -0
- package/dist/api-playground/ApiPlayground/Request/inputs/TextInput.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Response/CopyFileToClipboardButton.js +7 -0
- package/dist/api-playground/ApiPlayground/Response/CopyFileToClipboardButton.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Response/DownloadFileButton.js +45 -0
- package/dist/api-playground/ApiPlayground/Response/DownloadFileButton.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Response/ResponseBody/CodeResponseContent.js +54 -0
- package/dist/api-playground/ApiPlayground/Response/ResponseBody/CodeResponseContent.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Response/ResponseBody/index.js +15 -0
- package/dist/api-playground/ApiPlayground/Response/ResponseBody/index.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Response/ResponseError.js +14 -0
- package/dist/api-playground/ApiPlayground/Response/ResponseError.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Response/ResponseHeaders.js +12 -0
- package/dist/api-playground/ApiPlayground/Response/ResponseHeaders.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Response/ResponsePlaceholder.js +20 -0
- package/dist/api-playground/ApiPlayground/Response/ResponsePlaceholder.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Response/ResponseTable.js +21 -0
- package/dist/api-playground/ApiPlayground/Response/ResponseTable.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Response/ResponseTopbar.js +93 -0
- package/dist/api-playground/ApiPlayground/Response/ResponseTopbar.js.map +1 -0
- package/dist/api-playground/ApiPlayground/Response/index.js +80 -0
- package/dist/api-playground/ApiPlayground/Response/index.js.map +1 -0
- package/dist/api-playground/ApiPlayground/components/AdditionalItemButton.js +24 -0
- package/dist/api-playground/ApiPlayground/components/AdditionalItemButton.js.map +1 -0
- package/dist/api-playground/ApiPlayground/components/AdditionalPropertyButton.js +45 -0
- package/dist/api-playground/ApiPlayground/components/AdditionalPropertyButton.js.map +1 -0
- package/dist/api-playground/ApiPlayground/components/ArrayCount.js +18 -0
- package/dist/api-playground/ApiPlayground/components/ArrayCount.js.map +1 -0
- package/dist/api-playground/ApiPlayground/components/BasePathSelector.js +40 -0
- package/dist/api-playground/ApiPlayground/components/BasePathSelector.js.map +1 -0
- package/dist/api-playground/ApiPlayground/components/EndpointsMenu.js +44 -0
- package/dist/api-playground/ApiPlayground/components/EndpointsMenu.js.map +1 -0
- package/dist/api-playground/ApiPlayground/components/EndpointsMenuLink.js +45 -0
- package/dist/api-playground/ApiPlayground/components/EndpointsMenuLink.js.map +1 -0
- package/dist/api-playground/ApiPlayground/components/EndpointsMenuSearch.js +39 -0
- package/dist/api-playground/ApiPlayground/components/EndpointsMenuSearch.js.map +1 -0
- package/dist/api-playground/ApiPlayground/components/InputContainer.js +129 -0
- package/dist/api-playground/ApiPlayground/components/InputContainer.js.map +1 -0
- package/dist/api-playground/ApiPlayground/components/InputSectionContainer.js +60 -0
- package/dist/api-playground/ApiPlayground/components/InputSectionContainer.js.map +1 -0
- package/dist/api-playground/ApiPlayground/components/ModalHeader.js +16 -0
- package/dist/api-playground/ApiPlayground/components/ModalHeader.js.map +1 -0
- package/dist/api-playground/ApiPlayground/components/ObjectExpandButton.js +29 -0
- package/dist/api-playground/ApiPlayground/components/ObjectExpandButton.js.map +1 -0
- package/dist/api-playground/ApiPlayground/components/ParamFieldWrapper.js +20 -0
- package/dist/api-playground/ApiPlayground/components/ParamFieldWrapper.js.map +1 -0
- package/dist/api-playground/ApiPlayground/components/PathHeader.js +163 -0
- package/dist/api-playground/ApiPlayground/components/PathHeader.js.map +1 -0
- package/dist/api-playground/ApiPlayground/components/PlaygroundModalWrapper.js +59 -0
- package/dist/api-playground/ApiPlayground/components/PlaygroundModalWrapper.js.map +1 -0
- package/dist/api-playground/ApiPlayground/components/PrettyPath.js +50 -0
- package/dist/api-playground/ApiPlayground/components/PrettyPath.js.map +1 -0
- package/dist/api-playground/ApiPlayground/components/SendPill.js +40 -0
- package/dist/api-playground/ApiPlayground/components/SendPill.js.map +1 -0
- package/dist/api-playground/ApiPlayground/components/TrashButton.js +27 -0
- package/dist/api-playground/ApiPlayground/components/TrashButton.js.map +1 -0
- package/dist/api-playground/ApiPlayground/components/TypeDropdown.js +53 -0
- package/dist/api-playground/ApiPlayground/components/TypeDropdown.js.map +1 -0
- package/dist/api-playground/ApiPlayground/index.js +68 -0
- package/dist/api-playground/ApiPlayground/index.js.map +1 -0
- package/dist/api-playground/EndpointFields/ParamFields/ExampleDescription.js +51 -0
- package/dist/api-playground/EndpointFields/ParamFields/ExampleDescription.js.map +1 -0
- package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/Enum.js +20 -0
- package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/Enum.js.map +1 -0
- package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/NumberMetadata.js +19 -0
- package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/NumberMetadata.js.map +1 -0
- package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/StringMetadata.js +29 -0
- package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/StringMetadata.js.map +1 -0
- package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/index.js +6 -0
- package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/index.js.map +1 -0
- package/dist/api-playground/EndpointFields/ParamFields/RecursiveParamField.js +13 -0
- package/dist/api-playground/EndpointFields/ParamFields/RecursiveParamField.js.map +1 -0
- package/dist/api-playground/EndpointFields/components/Description.js +13 -0
- package/dist/api-playground/EndpointFields/components/Description.js.map +1 -0
- package/dist/api-playground/EndpointFields/components/OneOfDropdown.js +20 -0
- package/dist/api-playground/EndpointFields/components/OneOfDropdown.js.map +1 -0
- package/dist/api-playground/EndpointFields/components/OptionDropdown.js +36 -0
- package/dist/api-playground/EndpointFields/components/OptionDropdown.js.map +1 -0
- package/dist/api-playground/EndpointFields/components/SectionHeading.js +44 -0
- package/dist/api-playground/EndpointFields/components/SectionHeading.js.map +1 -0
- package/dist/api-playground/EndpointFields/index.js +7 -0
- package/dist/api-playground/EndpointFields/index.js.map +1 -0
- package/dist/api-playground-2/Api.js +13 -0
- package/dist/api-playground-2/Api.js.map +1 -0
- package/dist/api-playground-2/ApiExamples.js +19 -18
- package/dist/api-playground-2/ApiExamples.js.map +1 -1
- package/dist/api-playground-2/ApiFields.js +253 -0
- package/dist/api-playground-2/ApiFields.js.map +1 -0
- package/dist/api-playground-2/EndpointHeader.js +52 -0
- package/dist/api-playground-2/EndpointHeader.js.map +1 -0
- package/dist/api-playground-2/OperationPage.js +101 -0
- package/dist/api-playground-2/OperationPage.js.map +1 -0
- package/dist/api-playground-2/Playground.js +136 -0
- package/dist/api-playground-2/Playground.js.map +1 -0
- package/dist/api-playground-2/SchemaPage.js +14 -0
- package/dist/api-playground-2/SchemaPage.js.map +1 -0
- package/dist/api-playground-2/components/EndpointFields/EndpointSecurity.js +88 -0
- package/dist/api-playground-2/components/EndpointFields/EndpointSecurity.js.map +1 -0
- package/dist/api-playground-2/components/EndpointFields/fields/Enum.js +16 -0
- package/dist/api-playground-2/components/EndpointFields/fields/Enum.js.map +1 -0
- package/dist/api-playground-2/components/EndpointFields/fields/NumberMetadata.js +21 -0
- package/dist/api-playground-2/components/EndpointFields/fields/NumberMetadata.js.map +1 -0
- package/dist/api-playground-2/components/EndpointFields/fields/PrimitiveParamField.js +57 -0
- package/dist/api-playground-2/components/EndpointFields/fields/PrimitiveParamField.js.map +1 -0
- package/dist/api-playground-2/components/EndpointFields/fields/SimpleArrayParamField.js +90 -0
- package/dist/api-playground-2/components/EndpointFields/fields/SimpleArrayParamField.js.map +1 -0
- package/dist/api-playground-2/components/EndpointFields/fields/SimpleObjectParamField.js +122 -0
- package/dist/api-playground-2/components/EndpointFields/fields/SimpleObjectParamField.js.map +1 -0
- package/dist/api-playground-2/components/EndpointFields/fields/SimplePrimitiveParamField.js +75 -0
- package/dist/api-playground-2/components/EndpointFields/fields/SimplePrimitiveParamField.js.map +1 -0
- package/dist/api-playground-2/components/EndpointFields/fields/SimpleSchemaField.js +253 -0
- package/dist/api-playground-2/components/EndpointFields/fields/SimpleSchemaField.js.map +1 -0
- package/dist/api-playground-2/components/EndpointFields/fields/StringMetadata.js +28 -0
- package/dist/api-playground-2/components/EndpointFields/fields/StringMetadata.js.map +1 -0
- package/dist/api-playground-2/components/Example/GeneratedRequestExample.js +101 -114
- package/dist/api-playground-2/components/Example/GeneratedRequestExample.js.map +1 -1
- package/dist/api-playground-2/components/Request/BodySection.js +41 -0
- package/dist/api-playground-2/components/Request/BodySection.js.map +1 -0
- package/dist/api-playground-2/components/Request/InputSectionContainer.js +66 -0
- package/dist/api-playground-2/components/Request/InputSectionContainer.js.map +1 -0
- package/dist/api-playground-2/components/Request/ParameterSection.js +36 -0
- package/dist/api-playground-2/components/Request/ParameterSection.js.map +1 -0
- package/dist/api-playground-2/components/Request/SecuritySection.js +55 -0
- package/dist/api-playground-2/components/Request/SecuritySection.js.map +1 -0
- package/dist/api-playground-2/components/Request/ServerSection.js +33 -0
- package/dist/api-playground-2/components/Request/ServerSection.js.map +1 -0
- package/dist/api-playground-2/components/Request/inputs/ArrayInput.js +55 -0
- package/dist/api-playground-2/components/Request/inputs/ArrayInput.js.map +1 -0
- package/dist/api-playground-2/components/Request/inputs/DifferentiatedInput.js +48 -0
- package/dist/api-playground-2/components/Request/inputs/DifferentiatedInput.js.map +1 -0
- package/dist/api-playground-2/components/Request/inputs/FileInput.js +43 -0
- package/dist/api-playground-2/components/Request/inputs/FileInput.js.map +1 -0
- package/dist/api-playground-2/components/Request/inputs/InputContainer.js +127 -0
- package/dist/api-playground-2/components/Request/inputs/InputContainer.js.map +1 -0
- package/dist/api-playground-2/components/Request/inputs/NullInput.js +15 -0
- package/dist/api-playground-2/components/Request/inputs/NullInput.js.map +1 -0
- package/dist/api-playground-2/components/Request/inputs/NumberInput.js +46 -0
- package/dist/api-playground-2/components/Request/inputs/NumberInput.js.map +1 -0
- package/dist/api-playground-2/components/Request/inputs/ObjectInput.js +104 -0
- package/dist/api-playground-2/components/Request/inputs/ObjectInput.js.map +1 -0
- package/dist/api-playground-2/components/Request/inputs/OneOfInput.js +77 -0
- package/dist/api-playground-2/components/Request/inputs/OneOfInput.js.map +1 -0
- package/dist/api-playground-2/components/Request/inputs/SelectInput.js +54 -0
- package/dist/api-playground-2/components/Request/inputs/SelectInput.js.map +1 -0
- package/dist/api-playground-2/components/Request/inputs/StringInput.js +44 -0
- package/dist/api-playground-2/components/Request/inputs/StringInput.js.map +1 -0
- package/dist/api-playground-2/components/Request/inputs/TextInput.js +29 -0
- package/dist/api-playground-2/components/Request/inputs/TextInput.js.map +1 -0
- package/dist/api-playground-2/components/TypeDropdown.js +48 -0
- package/dist/api-playground-2/components/TypeDropdown.js.map +1 -0
- package/dist/api-playground-2/constants/index.js +6 -4
- package/dist/api-playground-2/constants/index.js.map +1 -1
- package/dist/api-playground-2/contexts/ApiPlaygroundContext.js +11 -0
- package/dist/api-playground-2/contexts/ApiPlaygroundContext.js.map +1 -0
- package/dist/api-playground-2/generators/generateInteractiveCodeSample.js +6 -6
- package/dist/api-playground-2/generators/generateInteractiveCodeSample.js.map +1 -1
- package/dist/api-playground-2/generators/generateSnippet.js +187 -36
- package/dist/api-playground-2/generators/generateSnippet.js.map +1 -1
- package/dist/api-playground-2/hooks/useCopyPathWithInputs.js +14 -0
- package/dist/api-playground-2/hooks/useCopyPathWithInputs.js.map +1 -0
- package/dist/api-playground-2/hooks/useInitializeInputs.js +101 -0
- package/dist/api-playground-2/hooks/useInitializeInputs.js.map +1 -0
- package/dist/api-playground-2/hooks/useSendPlaygroundRequest.js +156 -0
- package/dist/api-playground-2/hooks/useSendPlaygroundRequest.js.map +1 -0
- package/dist/api-playground-2/schemaGraph/addApiReferenceDataFromMdxAndDocsConfig.js +57 -0
- package/dist/api-playground-2/schemaGraph/addApiReferenceDataFromMdxAndDocsConfig.js.map +1 -0
- package/dist/api-playground-2/schemaGraph/processExamples.js +41 -8
- package/dist/api-playground-2/schemaGraph/processExamples.js.map +1 -1
- package/dist/api-playground-2/schemaGraph/processSecurityOptions.js +107 -0
- package/dist/api-playground-2/schemaGraph/processSecurityOptions.js.map +1 -0
- package/dist/api-playground-2/schemaGraph/utils.js +195 -43
- package/dist/api-playground-2/schemaGraph/utils.js.map +1 -1
- package/dist/api-playground-2/types/index.js +118 -0
- package/dist/api-playground-2/types/index.js.map +1 -0
- package/dist/common/guards.js +32 -6
- package/dist/common/guards.js.map +1 -1
- package/dist/common/potentiallyParseOpenApiString.js +25 -0
- package/dist/common/potentiallyParseOpenApiString.js.map +1 -0
- package/dist/common/replaceSlashIndex.js +7 -0
- package/dist/common/replaceSlashIndex.js.map +1 -0
- package/dist/common/slugToTitle.js +11 -0
- package/dist/common/slugToTitle.js.map +1 -0
- package/dist/components/Api/Expandable.js +119 -0
- package/dist/components/Api/Expandable.js.map +1 -0
- package/dist/components/Api/Markdown.js +66 -0
- package/dist/components/Api/Markdown.js.map +1 -0
- package/dist/components/Api/Param.js +191 -0
- package/dist/components/Api/Param.js.map +1 -0
- package/dist/components/content-components/code-block.js +68 -61
- package/dist/components/content-components/code-block.js.map +1 -1
- package/dist/components/content-components/code-group.js +36 -25
- package/dist/components/content-components/code-group.js.map +1 -1
- package/dist/components/content-components/getNodeText.js +5 -0
- package/dist/components/content-components/getNodeText.js.map +1 -0
- package/dist/constants/index.js +5 -0
- package/dist/constants/index.js.map +1 -0
- package/dist/constants/zIndex.js +7 -0
- package/dist/constants/zIndex.js.map +1 -0
- package/dist/contexts/ApiPlaygroundInputsContext.js +18 -0
- package/dist/contexts/ApiPlaygroundInputsContext.js.map +1 -0
- package/dist/contexts/ConfigContext.js +2 -3
- package/dist/contexts/ConfigContext.js.map +1 -1
- package/dist/contexts/EndpointLocationContext.js +18 -0
- package/dist/contexts/EndpointLocationContext.js.map +1 -0
- package/dist/contexts/MDXContentContext.js +19 -0
- package/dist/contexts/MDXContentContext.js.map +1 -0
- package/dist/env.js +6 -1
- package/dist/env.js.map +1 -1
- package/dist/hooks/useApiPlaygroundInputs.js +7 -0
- package/dist/hooks/useApiPlaygroundInputs.js.map +1 -0
- package/dist/hooks/useApiPlaygroundPrefillExamples.js +40 -0
- package/dist/hooks/useApiPlaygroundPrefillExamples.js.map +1 -0
- package/dist/hooks/useBaseUrlOptions.js +19 -0
- package/dist/hooks/useBaseUrlOptions.js.map +1 -0
- package/dist/hooks/useCheckHash.js +18 -0
- package/dist/hooks/useCheckHash.js.map +1 -0
- package/dist/hooks/useComponentSchemas.js +10 -0
- package/dist/hooks/useComponentSchemas.js.map +1 -0
- package/dist/hooks/useCurrentPath.js +17 -0
- package/dist/hooks/useCurrentPath.js.map +1 -0
- package/dist/hooks/useEndpoint.js +3 -3
- package/dist/hooks/useExpandableMemory.js +46 -0
- package/dist/hooks/useExpandableMemory.js.map +1 -0
- package/dist/hooks/useGenerateNextAdditionalProperties.js +12 -0
- package/dist/hooks/useGenerateNextAdditionalProperties.js.map +1 -0
- package/dist/hooks/useGenerateNextItems.js +12 -0
- package/dist/hooks/useGenerateNextItems.js.map +1 -0
- package/dist/hooks/useGenerateNextProperties.js +12 -0
- package/dist/hooks/useGenerateNextProperties.js.map +1 -0
- package/dist/hooks/useKeyboardShortcut.js +26 -0
- package/dist/hooks/useKeyboardShortcut.js.map +1 -0
- package/dist/hooks/useMDXContent.js +7 -0
- package/dist/hooks/useMDXContent.js.map +1 -0
- package/dist/hooks/useMDXContentController/useApiPlaygroundInputs.js +10 -0
- package/dist/hooks/useMDXContentController/useApiPlaygroundInputs.js.map +1 -0
- package/dist/hooks/useMDXContentController/useMDXContentCallbacks/useSetApiBaseIndexCallback.js +16 -0
- package/dist/hooks/useMDXContentController/useMDXContentCallbacks/useSetApiBaseIndexCallback.js.map +1 -0
- package/dist/hooks/useMDXContentController/useMDXContentCallbacks/useSetApiPlaygroundInputsCallback.js +16 -0
- package/dist/hooks/useMDXContentController/useMDXContentCallbacks/useSetApiPlaygroundInputsCallback.js.map +1 -0
- package/dist/hooks/usePlaygroundSchemaOptions.js +43 -0
- package/dist/hooks/usePlaygroundSchemaOptions.js.map +1 -0
- package/dist/hooks/usePrefilledInputs/index.js +66 -0
- package/dist/hooks/usePrefilledInputs/index.js.map +1 -0
- package/dist/hooks/usePrefilledInputs/storedServerVariables.js +30 -0
- package/dist/hooks/usePrefilledInputs/storedServerVariables.js.map +1 -0
- package/dist/hooks/useSecurityOption.js +11 -0
- package/dist/hooks/useSecurityOption.js.map +1 -0
- package/dist/hooks/useSendPlaygroundRequest.js +146 -15
- package/dist/hooks/useSendPlaygroundRequest.js.map +1 -1
- package/dist/hooks/useSetDefaultValue.js +64 -0
- package/dist/hooks/useSetDefaultValue.js.map +1 -0
- package/dist/index.d.ts +281 -0
- package/dist/index.js +143 -108
- package/dist/index.js.map +1 -1
- package/dist/openapi/filterEnums.js +21 -0
- package/dist/openapi/filterEnums.js.map +1 -0
- package/dist/openapi/generateNextAdditionalProperties.js +8 -0
- package/dist/openapi/generateNextAdditionalProperties.js.map +1 -0
- package/dist/openapi/generateNextItems.js +8 -0
- package/dist/openapi/generateNextItems.js.map +1 -0
- package/dist/openapi/generateNextProperties.js +24 -0
- package/dist/openapi/generateNextProperties.js.map +1 -0
- package/dist/openapi/generateOptionLabels.js +21 -0
- package/dist/openapi/generateOptionLabels.js.map +1 -0
- package/dist/openapi/generateSimpleLabels.js +5 -0
- package/dist/openapi/generateSimpleLabels.js.map +1 -0
- package/dist/openapi/generateTypeStringFromSchema.js +34 -0
- package/dist/openapi/generateTypeStringFromSchema.js.map +1 -0
- package/dist/openapi/getAuthFilteredSchemaArray.js +19 -0
- package/dist/openapi/getAuthFilteredSchemaArray.js.map +1 -0
- package/dist/paths/isEqualIgnoringLeadingSlash.js +22 -0
- package/dist/paths/isEqualIgnoringLeadingSlash.js.map +1 -0
- package/dist/paths/optionallyRemoveLeadingSlash.js +7 -0
- package/dist/paths/optionallyRemoveLeadingSlash.js.map +1 -0
- package/dist/paths/optionallyRemoveTrailingSlash.js +7 -0
- package/dist/paths/optionallyRemoveTrailingSlash.js.map +1 -0
- package/dist/utils/api-playground/defaults.js +16 -0
- package/dist/utils/api-playground/defaults.js.map +1 -0
- package/dist/utils/api-playground/paramFieldDefaults.js +11 -0
- package/dist/utils/api-playground/paramFieldDefaults.js.map +1 -0
- package/dist/utils/api-reference/getFilteredSecurityOptions.js +5 -0
- package/dist/utils/api-reference/getFilteredSecurityOptions.js.map +1 -0
- package/dist/utils/api-reference/getNextPropertiesByType.js +6 -0
- package/dist/utils/api-reference/getNextPropertiesByType.js.map +1 -0
- package/dist/utils/containsMarkdownTable.js +5 -0
- package/dist/utils/containsMarkdownTable.js.map +1 -0
- package/dist/utils/copyToClipboard.js +12 -0
- package/dist/utils/copyToClipboard.js.map +1 -0
- package/dist/utils/decodeSlug.js +8 -0
- package/dist/utils/decodeSlug.js.map +1 -0
- package/dist/utils/flattenObject.js +11 -0
- package/dist/utils/flattenObject.js.map +1 -0
- package/dist/utils/formatJSON.js +39 -0
- package/dist/utils/formatJSON.js.map +1 -0
- package/dist/utils/optionallyAddLeadingSlash.js +7 -0
- package/dist/utils/optionallyAddLeadingSlash.js.map +1 -0
- package/dist/utils/scrollElementIntoView.js +21 -0
- package/dist/utils/scrollElementIntoView.js.map +1 -0
- package/package.json +10 -10
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TypeDropdown.js","sources":["../../../../src/api-playground/ApiPlayground/components/TypeDropdown.tsx"],"sourcesContent":["'use client';\n\nimport { ChevronDownFilled } from '@fluentui/react-icons';\n\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from '@/components/Api/dropdown-menu';\nimport { SchemaWithLabelInfo } from '@/hooks/usePlaygroundSchemaOptions';\nimport { cn } from '@/api-playground-2/schemaGraph/utils';\n\ntype TypeDropdownParams = {\n options: SchemaWithLabelInfo[];\n selectedIndex: number;\n onSelectOption: (index: number) => void;\n className?: string;\n};\n\nfunction getOptionLabel(option?: SchemaWithLabelInfo) {\n if (!option) return;\n if (option.schema.deprecated) {\n return `${option.label}, deprecated`;\n }\n return option.label;\n}\n\nexport const TypeDropdown = ({\n options,\n selectedIndex,\n onSelectOption,\n className,\n}: TypeDropdownParams) => {\n const displayOptions = options.length > 1;\n const selectedOption = options[selectedIndex];\n\n return (\n <div\n className={cn(\n 'mint:relative mint:flex mint:items-center mint:px-2 mint:py-0.5 mint:text-gray-600 mint:dark:text-gray-300 mint:hover:text-gray-950 mint:dark:hover:text-white mint:font-medium',\n className\n )}\n >\n <DropdownMenu>\n <DropdownMenuTrigger\n disabled={!displayOptions}\n className=\"mint:font-mono mint:text-xs mint:text-gray-600 mint:dark:text-gray-300 mint:hover:text-gray-950 mint:dark:hover:text-white\"\n >\n <div className=\"mint:flex mint:items-center mint:gap-1.5\">\n <span>{getOptionLabel(selectedOption)}</span>\n {displayOptions && (\n <ChevronDownFilled className=\"mint:h-2.5 mint:w-2.5 mint:text-gray-500 mint:dark:text-gray-400 mint:shrink-0\" />\n )}\n </div>\n </DropdownMenuTrigger>\n <DropdownMenuContent className=\"mint:min-w-24\">\n {options.map((option, index) => (\n <DropdownMenuItem\n key={index}\n isSelected={index === selectedIndex}\n onSelect={() => onSelectOption(index)}\n className=\"mint:text-xs\"\n >\n {getOptionLabel(option)}\n </DropdownMenuItem>\n ))}\n </DropdownMenuContent>\n </DropdownMenu>\n </div>\n );\n};\n"],"names":["getOptionLabel","option","TypeDropdown","options","selectedIndex","onSelectOption","className","displayOptions","selectedOption","jsx","cn","DropdownMenu","DropdownMenuTrigger","jsxs","ChevronDownFilled","DropdownMenuContent","index","DropdownMenuItem"],"mappings":";;;;;AAoBA,SAASA,EAAeC,GAA8B;AACpD,MAAKA;AACL,WAAIA,EAAO,OAAO,aACT,GAAGA,EAAO,KAAK,iBAEjBA,EAAO;AAChB;AAEO,MAAMC,IAAe,CAAC;AAAA,EAC3B,SAAAC;AAAA,EACA,eAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,WAAAC;AACF,MAA0B;AACxB,QAAMC,IAAiBJ,EAAQ,SAAS,GAClCK,IAAiBL,EAAQC,CAAa;AAE5C,SACE,gBAAAK;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC;AAAA,QACT;AAAA,QACAJ;AAAA,MAAA;AAAA,MAGF,4BAACK,GAAA,EACC,UAAA;AAAA,QAAA,gBAAAF;AAAA,UAACG;AAAA,UAAA;AAAA,YACC,UAAU,CAACL;AAAA,YACX,WAAU;AAAA,YAEV,UAAA,gBAAAM,EAAC,OAAA,EAAI,WAAU,4CACb,UAAA;AAAA,cAAA,gBAAAJ,EAAC,QAAA,EAAM,UAAAT,EAAeQ,CAAc,EAAA,CAAE;AAAA,cACrCD,KACC,gBAAAE,EAACK,GAAA,EAAkB,WAAU,iFAAA,CAAiF;AAAA,YAAA,EAAA,CAElH;AAAA,UAAA;AAAA,QAAA;AAAA,QAEF,gBAAAL,EAACM,KAAoB,WAAU,iBAC5B,YAAQ,IAAI,CAACd,GAAQe,MACpB,gBAAAP;AAAA,UAACQ;AAAA,UAAA;AAAA,YAEC,YAAYD,MAAUZ;AAAA,YACtB,UAAU,MAAMC,EAAeW,CAAK;AAAA,YACpC,WAAU;AAAA,YAET,YAAef,CAAM;AAAA,UAAA;AAAA,UALjBe;AAAA,QAAA,CAOR,EAAA,CACH;AAAA,MAAA,EAAA,CACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { useContext as q, useState as n, useEffect as U } from "react";
|
|
3
|
+
import { DocsConfigContext as b } from "../../contexts/ConfigContext.js";
|
|
4
|
+
import { EndpointLocationProvider as L } from "../../contexts/EndpointLocationContext.js";
|
|
5
|
+
import { useBaseUrlOptions as T } from "../../hooks/useBaseUrlOptions.js";
|
|
6
|
+
import { useKeyboardShortcut as y } from "../../hooks/useKeyboardShortcut.js";
|
|
7
|
+
import { useApiPlaygroundInputs as j } from "../../hooks/useMDXContentController/useApiPlaygroundInputs.js";
|
|
8
|
+
import { useSetApiBaseIndexCallback as F } from "../../hooks/useMDXContentController/useMDXContentCallbacks/useSetApiBaseIndexCallback.js";
|
|
9
|
+
import { useSetApiPlaygroundInputsCallback as K } from "../../hooks/useMDXContentController/useMDXContentCallbacks/useSetApiPlaygroundInputsCallback.js";
|
|
10
|
+
import { useSendPlaygroundRequest as D } from "../../hooks/useSendPlaygroundRequest.js";
|
|
11
|
+
import N from "../../components/Api/ErrorBoundary.js";
|
|
12
|
+
import { ApiPlaygroundContext as Q } from "./ApiPlaygroundContext.js";
|
|
13
|
+
import { Request as W } from "./Request/index.js";
|
|
14
|
+
const ne = ({ endpoint: r, display: f }) => {
|
|
15
|
+
var m, p;
|
|
16
|
+
const { docsConfig: a } = q(b), x = j(), h = K(), I = F(), e = T(), [c, g] = n(0), [l, i] = n(!1), [P, S] = n(!1), [w, E] = n(), [B, _] = n(0), k = Object.keys(r.request.body)[B], [v, A] = n(0), C = (e == null ? void 0 : e[c]) ?? (e == null ? void 0 : e[0]) ?? "";
|
|
17
|
+
U(() => {
|
|
18
|
+
new URLSearchParams(window.location.search).has("playground") && requestAnimationFrame(() => {
|
|
19
|
+
i(!0);
|
|
20
|
+
});
|
|
21
|
+
}, []);
|
|
22
|
+
const d = D({
|
|
23
|
+
endpoint: r,
|
|
24
|
+
baseUrl: C,
|
|
25
|
+
contentType: k ?? "application/json",
|
|
26
|
+
setIsFetching: S,
|
|
27
|
+
setResult: E
|
|
28
|
+
}), R = (t) => {
|
|
29
|
+
g(t), I(t);
|
|
30
|
+
}, u = (t) => {
|
|
31
|
+
if (i(t), t) {
|
|
32
|
+
const o = new URL(window.location.href);
|
|
33
|
+
o.searchParams.set("playground", "open"), window.history.replaceState({}, "", o);
|
|
34
|
+
} else {
|
|
35
|
+
const o = new URL(window.location.href);
|
|
36
|
+
o.searchParams.delete("playground"), window.history.replaceState({}, "", o);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
return y({
|
|
40
|
+
key: "Enter",
|
|
41
|
+
callback: ((p = (m = a == null ? void 0 : a.api) == null ? void 0 : m.playground) == null ? void 0 : p.display) === "interactive" ? d : void 0
|
|
42
|
+
}), y({
|
|
43
|
+
key: "Escape",
|
|
44
|
+
callback: l ? () => u(!1) : void 0,
|
|
45
|
+
isSingleKey: !0
|
|
46
|
+
}), /* @__PURE__ */ s(N, { children: /* @__PURE__ */ s(
|
|
47
|
+
Q.Provider,
|
|
48
|
+
{
|
|
49
|
+
value: {
|
|
50
|
+
isSending: P,
|
|
51
|
+
sendRequest: d,
|
|
52
|
+
result: w,
|
|
53
|
+
setSelectedBaseUrlIndex: R,
|
|
54
|
+
selectedBaseUrlIndex: c,
|
|
55
|
+
baseUrlOptions: e,
|
|
56
|
+
isPlaygroundExpanded: l,
|
|
57
|
+
setIsPlaygroundExpanded: u,
|
|
58
|
+
selectedExampleIndex: v,
|
|
59
|
+
setSelectedExampleIndex: A
|
|
60
|
+
},
|
|
61
|
+
children: /* @__PURE__ */ s("div", { className: "mint:mt-6 mint:flex mint:w-full mint:flex-col mint:space-y-4", children: /* @__PURE__ */ s(L, { location: "request", children: /* @__PURE__ */ s(W, { inputs: x, setInputs: h, endpoint: r, display: f }) }) })
|
|
62
|
+
}
|
|
63
|
+
) });
|
|
64
|
+
};
|
|
65
|
+
export {
|
|
66
|
+
ne as ApiPlayground
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/api-playground/ApiPlayground/index.tsx"],"sourcesContent":["'use client';\n\nimport { ApiPlaygroundResultType, ApiPlaygroundDisplayType } from '@mintlify/models';\nimport { Endpoint } from '@mintlify/validation';\nimport { useContext, useEffect, useState } from 'react';\n\nimport { DocsConfigContext } from '@/contexts/ConfigContext';\nimport { EndpointLocationProvider } from '@/contexts/EndpointLocationContext';\nimport { useBaseUrlOptions } from '../../hooks/useBaseUrlOptions';\nimport { useKeyboardShortcut } from '@/hooks/useKeyboardShortcut';\nimport { useApiPlaygroundInputs } from '@/hooks/useMDXContentController/useApiPlaygroundInputs';\nimport { useSetApiBaseIndexCallback } from '@/hooks/useMDXContentController/useMDXContentCallbacks/useSetApiBaseIndexCallback';\nimport { useSetApiPlaygroundInputsCallback } from '@/hooks/useMDXContentController/useMDXContentCallbacks/useSetApiPlaygroundInputsCallback';\nimport { useSendPlaygroundRequest } from '@/hooks/useSendPlaygroundRequest';\nimport ErrorBoundary from '@/components/Api/ErrorBoundary';\n\nimport { ApiPlaygroundContext } from './ApiPlaygroundContext';\nimport { Request } from './Request';\nimport { cn } from \"../../utils/cn\";\n\ntype ApiPlaygroundParams = {\n endpoint: Endpoint;\n display: ApiPlaygroundDisplayType;\n};\n\nexport const ApiPlayground = ({ endpoint, display }: ApiPlaygroundParams) => {\n const { docsConfig } = useContext(DocsConfigContext);\n const inputs = useApiPlaygroundInputs();\n const setInputs = useSetApiPlaygroundInputsCallback();\n const setApiBaseIndex = useSetApiBaseIndexCallback();\n\n const baseUrlOptions = useBaseUrlOptions();\n const [selectedBaseUrlIndex, setSelectedBaseUrlIndex] = useState(0);\n const [isPlaygroundExpanded, setIsPlaygroundExpanded] = useState(false);\n\n const [isSending, setIsSending] = useState(false);\n const [result, setResult] = useState<ApiPlaygroundResultType>();\n\n const [selectedContentTypeIndex, _setSelectedContentTypeIndex] = useState(0);\n const contentType = Object.keys(endpoint.request.body)[selectedContentTypeIndex];\n const [selectedExampleIndex, setSelectedExampleIndex] = useState(0);\n\n const baseUrl = baseUrlOptions?.[selectedBaseUrlIndex] ?? baseUrlOptions?.[0] ?? '';\n\n useEffect(() => {\n const searchParams = new URLSearchParams(window.location.search);\n if (searchParams.has('playground')) {\n requestAnimationFrame(() => {\n setIsPlaygroundExpanded(true);\n });\n }\n }, []);\n\n const sendRequest = useSendPlaygroundRequest({\n endpoint,\n baseUrl,\n contentType: contentType ?? 'application/json',\n setIsFetching: setIsSending,\n setResult,\n });\n\n const setBaseUrlIndex = (index: number) => {\n setSelectedBaseUrlIndex(index);\n setApiBaseIndex(index);\n };\n\n const setIsPlaygroundExpandedWithQueryParam = (expanded: boolean) => {\n setIsPlaygroundExpanded(expanded);\n if (expanded) {\n const url = new URL(window.location.href);\n url.searchParams.set('playground', 'open');\n window.history.replaceState({}, '', url);\n } else {\n const url = new URL(window.location.href);\n url.searchParams.delete('playground');\n window.history.replaceState({}, '', url);\n }\n };\n\n useKeyboardShortcut({\n key: 'Enter',\n callback: docsConfig?.api?.playground?.display === 'interactive' ? sendRequest : undefined,\n });\n useKeyboardShortcut({\n key: 'Escape',\n callback: isPlaygroundExpanded ? () => setIsPlaygroundExpandedWithQueryParam(false) : undefined,\n isSingleKey: true,\n });\n\n return (\n <ErrorBoundary>\n <ApiPlaygroundContext.Provider\n value={{\n isSending,\n sendRequest,\n result,\n setSelectedBaseUrlIndex: setBaseUrlIndex,\n selectedBaseUrlIndex,\n baseUrlOptions,\n isPlaygroundExpanded,\n setIsPlaygroundExpanded: setIsPlaygroundExpandedWithQueryParam,\n selectedExampleIndex,\n setSelectedExampleIndex,\n }}\n >\n <div className=\"mint:mt-6 mint:flex mint:w-full mint:flex-col mint:space-y-4\">\n <EndpointLocationProvider location=\"request\">\n <Request inputs={inputs} setInputs={setInputs} endpoint={endpoint} display={display} />\n </EndpointLocationProvider>\n </div>\n </ApiPlaygroundContext.Provider>\n </ErrorBoundary>\n );\n};\n"],"names":["ApiPlayground","endpoint","display","docsConfig","useContext","DocsConfigContext","inputs","useApiPlaygroundInputs","setInputs","useSetApiPlaygroundInputsCallback","setApiBaseIndex","useSetApiBaseIndexCallback","baseUrlOptions","useBaseUrlOptions","selectedBaseUrlIndex","setSelectedBaseUrlIndex","useState","isPlaygroundExpanded","setIsPlaygroundExpanded","isSending","setIsSending","result","setResult","selectedContentTypeIndex","_setSelectedContentTypeIndex","contentType","selectedExampleIndex","setSelectedExampleIndex","baseUrl","useEffect","sendRequest","useSendPlaygroundRequest","setBaseUrlIndex","index","setIsPlaygroundExpandedWithQueryParam","expanded","url","useKeyboardShortcut","_b","_a","ErrorBoundary","jsx","ApiPlaygroundContext","EndpointLocationProvider","Request"],"mappings":";;;;;;;;;;;;;AAyBO,MAAMA,KAAgB,CAAC,EAAE,UAAAC,GAAU,SAAAC,QAAmC;;AAC3E,QAAM,EAAE,YAAAC,EAAA,IAAeC,EAAWC,CAAiB,GAC7CC,IAASC,EAAA,GACTC,IAAYC,EAAA,GACZC,IAAkBC,EAAA,GAElBC,IAAiBC,EAAA,GACjB,CAACC,GAAsBC,CAAuB,IAAIC,EAAS,CAAC,GAC5D,CAACC,GAAsBC,CAAuB,IAAIF,EAAS,EAAK,GAEhE,CAACG,GAAWC,CAAY,IAAIJ,EAAS,EAAK,GAC1C,CAACK,GAAQC,CAAS,IAAIN,EAAA,GAEtB,CAACO,GAA0BC,CAA4B,IAAIR,EAAS,CAAC,GACrES,IAAc,OAAO,KAAKxB,EAAS,QAAQ,IAAI,EAAEsB,CAAwB,GACzE,CAACG,GAAsBC,CAAuB,IAAIX,EAAS,CAAC,GAE5DY,KAAUhB,KAAA,gBAAAA,EAAiBE,QAAyBF,KAAA,gBAAAA,EAAiB,OAAM;AAEjF,EAAAiB,EAAU,MAAM;AAEd,IADqB,IAAI,gBAAgB,OAAO,SAAS,MAAM,EAC9C,IAAI,YAAY,KAC/B,sBAAsB,MAAM;AAC1B,MAAAX,EAAwB,EAAI;AAAA,IAC9B,CAAC;AAAA,EAEL,GAAG,CAAA,CAAE;AAEL,QAAMY,IAAcC,EAAyB;AAAA,IAC3C,UAAA9B;AAAA,IACA,SAAA2B;AAAA,IACA,aAAaH,KAAe;AAAA,IAC5B,eAAeL;AAAA,IACf,WAAAE;AAAA,EAAA,CACD,GAEKU,IAAkB,CAACC,MAAkB;AACzC,IAAAlB,EAAwBkB,CAAK,GAC7BvB,EAAgBuB,CAAK;AAAA,EACvB,GAEMC,IAAwC,CAACC,MAAsB;AAEnE,QADAjB,EAAwBiB,CAAQ,GAC5BA,GAAU;AACZ,YAAMC,IAAM,IAAI,IAAI,OAAO,SAAS,IAAI;AACxC,MAAAA,EAAI,aAAa,IAAI,cAAc,MAAM,GACzC,OAAO,QAAQ,aAAa,CAAA,GAAI,IAAIA,CAAG;AAAA,IACzC,OAAO;AACL,YAAMA,IAAM,IAAI,IAAI,OAAO,SAAS,IAAI;AACxC,MAAAA,EAAI,aAAa,OAAO,YAAY,GACpC,OAAO,QAAQ,aAAa,CAAA,GAAI,IAAIA,CAAG;AAAA,IACzC;AAAA,EACF;AAEA,SAAAC,EAAoB;AAAA,IAClB,KAAK;AAAA,IACL,YAAUC,KAAAC,IAAApC,KAAA,gBAAAA,EAAY,QAAZ,gBAAAoC,EAAiB,eAAjB,gBAAAD,EAA6B,aAAY,gBAAgBR,IAAc;AAAA,EAAA,CAClF,GACDO,EAAoB;AAAA,IAClB,KAAK;AAAA,IACL,UAAUpB,IAAuB,MAAMiB,EAAsC,EAAK,IAAI;AAAA,IACtF,aAAa;AAAA,EAAA,CACd,qBAGEM,GAAA,EACC,UAAA,gBAAAC;AAAA,IAACC,EAAqB;AAAA,IAArB;AAAA,MACC,OAAO;AAAA,QACL,WAAAvB;AAAA,QACA,aAAAW;AAAA,QACA,QAAAT;AAAA,QACA,yBAAyBW;AAAA,QACzB,sBAAAlB;AAAA,QACA,gBAAAF;AAAA,QACA,sBAAAK;AAAA,QACA,yBAAyBiB;AAAA,QACzB,sBAAAR;AAAA,QACA,yBAAAC;AAAA,MAAA;AAAA,MAGF,UAAA,gBAAAc,EAAC,OAAA,EAAI,WAAU,gEACb,4BAACE,GAAA,EAAyB,UAAS,WACjC,UAAA,gBAAAF,EAACG,KAAQ,QAAAtC,GAAgB,WAAAE,GAAsB,UAAAP,GAAoB,SAAAC,GAAkB,GACvF,EAAA,CACF;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsxs as r, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import "@mintlify/validation";
|
|
3
|
+
import { cn as e } from "../../../utils/cn.js";
|
|
4
|
+
import { formatJSON as s } from "../../../utils/formatJSON.js";
|
|
5
|
+
import { Description as a } from "../components/Description.js";
|
|
6
|
+
function m({ example: t }) {
|
|
7
|
+
return /* @__PURE__ */ n(
|
|
8
|
+
a,
|
|
9
|
+
{
|
|
10
|
+
className: "mint:overflow-wrap-anywhere mint:text-[13px] mint:**:text-[13px]",
|
|
11
|
+
markdown: typeof t == "object" && t !== null ? `\`\`\`json
|
|
12
|
+
${s(t)}
|
|
13
|
+
\`\`\`` : `\`${t === "null" ? null : JSON.stringify(t, void 0, 2)}\``
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
const v = ({
|
|
18
|
+
schema: t
|
|
19
|
+
}) => {
|
|
20
|
+
const o = t.example, i = t.examples !== void 0 ? Array.isArray(t.examples) ? t.examples : [t.examples] : void 0;
|
|
21
|
+
return o !== void 0 && /* @__PURE__ */ r(
|
|
22
|
+
"div",
|
|
23
|
+
{
|
|
24
|
+
className: e(
|
|
25
|
+
"mint:flex mint:prose mint:prose-sm mint:prose-gray mint:dark:prose-invert mint:mt-6 mint:gap-1.5",
|
|
26
|
+
(typeof o == "object" || typeof (i == null ? void 0 : i[0]) == "object") && "mint:flex-col mint:gap-y-3"
|
|
27
|
+
),
|
|
28
|
+
children: [
|
|
29
|
+
/* @__PURE__ */ r("span", { children: [
|
|
30
|
+
"Example",
|
|
31
|
+
i && i.length ? "s" : "",
|
|
32
|
+
":"
|
|
33
|
+
] }),
|
|
34
|
+
i !== void 0 ? /* @__PURE__ */ n(
|
|
35
|
+
"div",
|
|
36
|
+
{
|
|
37
|
+
className: e(
|
|
38
|
+
"mint:*:my-2",
|
|
39
|
+
typeof i[0] != "object" && "mint:inline mint:*:mr-2 mint:**:inline"
|
|
40
|
+
),
|
|
41
|
+
children: i.map((p, l) => /* @__PURE__ */ n(m, { example: p }, l))
|
|
42
|
+
}
|
|
43
|
+
) : /* @__PURE__ */ n(m, { example: o })
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
export {
|
|
49
|
+
v as ExampleDescription
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=ExampleDescription.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExampleDescription.js","sources":["../../../../src/api-playground/EndpointFields/ParamFields/ExampleDescription.tsx"],"sourcesContent":["import { cn } from '@/api-playground-2/schemaGraph/utils';\nimport { formatJSON } from '@/utils/formatJSON';\n\nimport { Description } from '../components/Description';\n\nfunction Example({ example }: { example: Exclude<unknown, undefined> }) {\n return (\n <Description\n className=\"mint:overflow-wrap-anywhere mint:text-[13px] mint:**:text-[13px]\"\n markdown={\n typeof example === 'object' && example !== null\n ? `\\`\\`\\`json\\n${formatJSON(example)}\\n\\`\\`\\``\n : `\\`${example === 'null' ? null : JSON.stringify(example, undefined, 2)}\\``\n }\n />\n );\n}\n\nexport const ExampleDescription = ({\n schema,\n}: {\n schema: {\n example?: unknown;\n examples?: unknown[];\n };\n}) => {\n const example = schema.example;\n const examples =\n schema.examples !== undefined\n ? Array.isArray(schema.examples)\n ? schema.examples\n : [schema.examples]\n : undefined;\n return (\n example !== undefined && (\n <div\n className={cn(\n 'mint:flex mint:prose mint:prose-sm mint:prose-gray mint:dark:prose-invert mint:mt-6 mint:gap-1.5',\n (typeof example === 'object' || typeof examples?.[0] === 'object') && 'mint:flex-col mint:gap-y-3'\n )}\n >\n <span>Example{examples && examples.length ? 's' : ''}:</span>\n {examples !== undefined ? (\n <div\n className={cn(\n 'mint:*:my-2',\n typeof examples[0] !== 'object' && 'mint:inline mint:*:mr-2 mint:**:inline'\n )}\n >\n {examples.map((ex, index) => {\n return <Example key={index} example={ex} />;\n })}\n </div>\n ) : (\n <Example example={example} />\n )}\n </div>\n )\n );\n};\n"],"names":["Example","example","jsx","Description","formatJSON","ExampleDescription","schema","examples","jsxs","cn","ex","index"],"mappings":";;;;;AAKA,SAASA,EAAQ,EAAE,SAAAC,KAAqD;AACtE,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAU;AAAA,MACV,UACE,OAAOF,KAAY,YAAYA,MAAY,OACvC;AAAA,EAAeG,EAAWH,CAAO,CAAC;AAAA,UAClC,KAAKA,MAAY,SAAS,OAAO,KAAK,UAAUA,GAAS,QAAW,CAAC,CAAC;AAAA,IAAA;AAAA,EAAA;AAIlF;AAEO,MAAMI,IAAqB,CAAC;AAAA,EACjC,QAAAC;AACF,MAKM;AACJ,QAAML,IAAUK,EAAO,SACjBC,IACJD,EAAO,aAAa,SAChB,MAAM,QAAQA,EAAO,QAAQ,IAC3BA,EAAO,WACP,CAACA,EAAO,QAAQ,IAClB;AACN,SACEL,MAAY,UACV,gBAAAO;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC;AAAA,QACT;AAAA,SACC,OAAOR,KAAY,YAAY,QAAOM,KAAA,gBAAAA,EAAW,OAAO,aAAa;AAAA,MAAA;AAAA,MAGxE,UAAA;AAAA,QAAA,gBAAAC,EAAC,QAAA,EAAK,UAAA;AAAA,UAAA;AAAA,UAAQD,KAAYA,EAAS,SAAS,MAAM;AAAA,UAAG;AAAA,QAAA,GAAC;AAAA,QACrDA,MAAa,SACZ,gBAAAL;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAWO;AAAA,cACT;AAAA,cACA,OAAOF,EAAS,CAAC,KAAM,YAAY;AAAA,YAAA;AAAA,YAGpC,UAAAA,EAAS,IAAI,CAACG,GAAIC,MACV,gBAAAT,EAACF,GAAA,EAAoB,SAASU,EAAA,GAAhBC,CAAoB,CAC1C;AAAA,UAAA;AAAA,QAAA,IAGH,gBAAAT,EAACF,GAAA,EAAQ,SAAAC,EAAA,CAAkB;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAKrC;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsxs as i, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { useSelectedLocale as o } from "../../../../utils/locales/index.js";
|
|
3
|
+
import { getXFilteredEnumValues as m } from "../../../../openapi/filterEnums.js";
|
|
4
|
+
const d = ({ schema: r }) => {
|
|
5
|
+
const e = m({ schema: r, userGroups: void 0 }), s = o();
|
|
6
|
+
return e.length === 0 ? null : /* @__PURE__ */ i("div", { className: "mint:whitespace-pre-wrap mint:prose-sm mint:mt-6", children: [
|
|
7
|
+
s.availableOptions,
|
|
8
|
+
":",
|
|
9
|
+
" ",
|
|
10
|
+
e.map((t, n) => /* @__PURE__ */ i("div", { className: "mint:inline-block", children: [
|
|
11
|
+
/* @__PURE__ */ l("code", { children: t }),
|
|
12
|
+
n !== e.length - 1 && ",",
|
|
13
|
+
" "
|
|
14
|
+
] }, `${t}-${n}`))
|
|
15
|
+
] });
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
d as EnumOptions
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=Enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Enum.js","sources":["../../../../../src/api-playground/EndpointFields/ParamFields/PrimitiveParamField/Enum.tsx"],"sourcesContent":["import {\n DataSchemaArray,\n IncrementalDataSchemaArray,\n NumberEnumSchema,\n StringEnumSchema,\n} from '@mintlify/validation';\n\nimport { useSelectedLocale } from '@/utils/locales';\nimport { getXFilteredEnumValues } from '@/openapi/filterEnums';\n\nimport { isEnum } from '.';\nimport { cn } from \"../../../../utils/cn\";\n\nexport const EnumOptions = ({ schema }: { schema: NumberEnumSchema | StringEnumSchema }) => {\n const enumValues = getXFilteredEnumValues({ schema, userGroups: undefined });\n const locale = useSelectedLocale();\n\n if (enumValues.length === 0) {\n return null;\n }\n\n return (\n <div className=\"mint:whitespace-pre-wrap mint:prose-sm mint:mt-6\">\n {locale['availableOptions']}:{' '}\n {enumValues.map((enumValue: string | number, i: number) => (\n <div key={`${enumValue}-${i}`} className=\"mint:inline-block\">\n <code>{enumValue}</code>\n {i !== enumValues.length - 1 && ','}{' '}\n </div>\n ))}\n </div>\n );\n};\n\nexport const EnumConstTable = ({\n schemaArray,\n}: {\n schemaArray: DataSchemaArray | IncrementalDataSchemaArray;\n}) => {\n return (\n <div className=\"mint:whitespace-pre-wrap mint:prose mint:prose-sm mint:mt-6\">\n Available options:\n <table className=\"mint:w-min mint:max-w-full mint:text-sm not-prose\">\n <tr>\n <th className=\"mint:text-left\">Title</th>\n <th>Const</th>\n </tr>\n {schemaArray.map((schema) => {\n if (isEnum(schema) && 'const' in schema) {\n return (\n <tr key={schema.title}>\n <td>{schema.title}</td>\n <td>\n <code>{schema.const}</code>\n </td>\n </tr>\n );\n }\n })}\n </table>\n </div>\n );\n};\n"],"names":["EnumOptions","schema","enumValues","getXFilteredEnumValues","locale","useSelectedLocale","jsxs","enumValue","i","jsx"],"mappings":";;;AAaO,MAAMA,IAAc,CAAC,EAAE,QAAAC,QAA8D;AAC1F,QAAMC,IAAaC,EAAuB,EAAE,QAAAF,GAAQ,YAAY,QAAW,GACrEG,IAASC,EAAA;AAEf,SAAIH,EAAW,WAAW,IACjB,OAIP,gBAAAI,EAAC,OAAA,EAAI,WAAU,oDACZ,UAAA;AAAA,IAAAF,EAAO;AAAA,IAAoB;AAAA,IAAE;AAAA,IAC7BF,EAAW,IAAI,CAACK,GAA4BC,MAC3C,gBAAAF,EAAC,OAAA,EAA8B,WAAU,qBACvC,UAAA;AAAA,MAAA,gBAAAG,EAAC,UAAM,UAAAF,EAAA,CAAU;AAAA,MAChBC,MAAMN,EAAW,SAAS,KAAK;AAAA,MAAK;AAAA,IAAA,EAAA,GAF7B,GAAGK,CAAS,IAAIC,CAAC,EAG3B,CACD;AAAA,EAAA,GACH;AAEJ;"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsxs as u, Fragment as r, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
const o = ({ schema: i }) => {
|
|
3
|
+
const e = i.exclusiveMinimum || i.exclusiveMinimum !== void 0, n = i.exclusiveMaximum || i.exclusiveMaximum !== void 0;
|
|
4
|
+
let m = "";
|
|
5
|
+
return i.maximum !== void 0 && (m = `x ${n ? "<" : "<="} ${i.maximum}`), i.minimum !== void 0 && (m = `x ${e ? ">" : ">="} ${i.minimum}`), i.maximum !== void 0 && i.minimum !== void 0 && (m = `${i.minimum} ${e ? "<" : "<="} x ${n ? "<" : "<="} ${i.maximum}`), m === "" && i.multipleOf === void 0 ? null : /* @__PURE__ */ u("div", { className: "mint:prose mint:prose-sm mint:prose-gray mint:dark:prose-invert mint:mt-6", children: [
|
|
6
|
+
m && /* @__PURE__ */ u(r, { children: [
|
|
7
|
+
"Required range: ",
|
|
8
|
+
/* @__PURE__ */ l("code", { children: m })
|
|
9
|
+
] }),
|
|
10
|
+
i.multipleOf && /* @__PURE__ */ u(r, { children: [
|
|
11
|
+
"Must be a multiple of ",
|
|
12
|
+
/* @__PURE__ */ l("code", { children: i.multipleOf })
|
|
13
|
+
] })
|
|
14
|
+
] });
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
o as NumberMetadata
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=NumberMetadata.js.map
|
package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/NumberMetadata.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NumberMetadata.js","sources":["../../../../../src/api-playground/EndpointFields/ParamFields/PrimitiveParamField/NumberMetadata.tsx"],"sourcesContent":["'use client';\n\nimport { NumberSchema } from '@mintlify/validation';\n\nexport const NumberMetadata = ({ schema }: { schema: NumberSchema }) => {\n const exclusiveMinimum = schema.exclusiveMinimum || schema.exclusiveMinimum !== undefined;\n const exclusiveMaximum = schema.exclusiveMaximum || schema.exclusiveMaximum !== undefined;\n let range = '';\n if (schema.maximum !== undefined) {\n range = `x ${exclusiveMaximum ? '<' : '<='} ${schema.maximum}`;\n }\n if (schema.minimum !== undefined) {\n range = `x ${exclusiveMinimum ? '>' : '>='} ${schema.minimum}`;\n }\n if (schema.maximum !== undefined && schema.minimum !== undefined) {\n range = `${schema.minimum} ${exclusiveMinimum ? '<' : '<='} x ${exclusiveMaximum ? '<' : '<='} ${schema.maximum}`;\n }\n if (range === '' && schema.multipleOf === undefined) {\n return null;\n }\n return (\n <div className=\"mint:prose mint:prose-sm mint:prose-gray mint:dark:prose-invert mint:mt-6\">\n {range && (\n <>\n Required range: <code>{range}</code>\n </>\n )}\n {schema.multipleOf && (\n <>\n Must be a multiple of <code>{schema.multipleOf}</code>\n </>\n )}\n </div>\n );\n};\n"],"names":["NumberMetadata","schema","exclusiveMinimum","exclusiveMaximum","range","jsxs","Fragment","jsx"],"mappings":";AAIO,MAAMA,IAAiB,CAAC,EAAE,QAAAC,QAAuC;AACtE,QAAMC,IAAmBD,EAAO,oBAAoBA,EAAO,qBAAqB,QAC1EE,IAAmBF,EAAO,oBAAoBA,EAAO,qBAAqB;AAChF,MAAIG,IAAQ;AAUZ,SATIH,EAAO,YAAY,WACrBG,IAAQ,KAAKD,IAAmB,MAAM,IAAI,IAAIF,EAAO,OAAO,KAE1DA,EAAO,YAAY,WACrBG,IAAQ,KAAKF,IAAmB,MAAM,IAAI,IAAID,EAAO,OAAO,KAE1DA,EAAO,YAAY,UAAaA,EAAO,YAAY,WACrDG,IAAQ,GAAGH,EAAO,OAAO,IAAIC,IAAmB,MAAM,IAAI,MAAMC,IAAmB,MAAM,IAAI,IAAIF,EAAO,OAAO,KAE7GG,MAAU,MAAMH,EAAO,eAAe,SACjC,OAGP,gBAAAI,EAAC,OAAA,EAAI,WAAU,6EACZ,UAAA;AAAA,IAAAD,KACC,gBAAAC,EAAAC,GAAA,EAAE,UAAA;AAAA,MAAA;AAAA,MACgB,gBAAAC,EAAC,UAAM,UAAAH,EAAA,CAAM;AAAA,IAAA,GAC/B;AAAA,IAEDH,EAAO,cACN,gBAAAI,EAAAC,GAAA,EAAE,UAAA;AAAA,MAAA;AAAA,MACsB,gBAAAC,EAAC,QAAA,EAAM,UAAAN,EAAO,WAAA,CAAW;AAAA,IAAA,EAAA,CACjD;AAAA,EAAA,GAEJ;AAEJ;"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsxs as n, Fragment as t, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import "@mintlify/validation";
|
|
3
|
+
import { cn as d } from "../../../../utils/cn.js";
|
|
4
|
+
const s = ({
|
|
5
|
+
schema: r,
|
|
6
|
+
description: i
|
|
7
|
+
}) => /* @__PURE__ */ n(t, { children: [
|
|
8
|
+
r.const !== void 0 && /* @__PURE__ */ n("div", { className: d("mint:prose mint:prose-sm mint:prose-gray mint:dark:prose-invert", i && "mint:mt-6"), children: [
|
|
9
|
+
"Allowed value: ",
|
|
10
|
+
/* @__PURE__ */ e("code", { children: `"${r.const}"` })
|
|
11
|
+
] }),
|
|
12
|
+
(r.minLength !== void 0 || r.maxLength !== void 0) && /* @__PURE__ */ e("div", { className: d("mint:prose mint:prose-sm mint:prose-gray mint:dark:prose-invert", i && "mint:mt-6"), children: /* @__PURE__ */ e(o, { minLength: r.minLength, maxLength: r.maxLength }) })
|
|
13
|
+
] }), o = ({ minLength: r, maxLength: i }) => r === i && r !== void 0 ? /* @__PURE__ */ n(t, { children: [
|
|
14
|
+
"Required string length: ",
|
|
15
|
+
/* @__PURE__ */ e("code", { children: r })
|
|
16
|
+
] }) : r && i ? /* @__PURE__ */ n(t, { children: [
|
|
17
|
+
"Required string length: ",
|
|
18
|
+
/* @__PURE__ */ e("code", { children: `${r} - ${i}` })
|
|
19
|
+
] }) : r ? /* @__PURE__ */ n(t, { children: [
|
|
20
|
+
"Minimum length: ",
|
|
21
|
+
/* @__PURE__ */ e("code", { children: r })
|
|
22
|
+
] }) : i ? /* @__PURE__ */ n(t, { children: [
|
|
23
|
+
"Maximum length: ",
|
|
24
|
+
/* @__PURE__ */ e("code", { children: i })
|
|
25
|
+
] }) : "";
|
|
26
|
+
export {
|
|
27
|
+
s as StringMetadata
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=StringMetadata.js.map
|
package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/StringMetadata.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StringMetadata.js","sources":["../../../../../src/api-playground/EndpointFields/ParamFields/PrimitiveParamField/StringMetadata.tsx"],"sourcesContent":["'use client';\n\nimport { StringSchema } from '@mintlify/validation';\n\nimport { cn } from '@/api-playground-2/schemaGraph/utils';\n\nexport const StringMetadata = ({\n schema,\n description,\n}: {\n schema: StringSchema;\n description?: string;\n}) => {\n return (\n <>\n {schema.const !== undefined && (\n <div className={cn('mint:prose mint:prose-sm mint:prose-gray mint:dark:prose-invert', description && 'mint:mt-6')}>\n Allowed value: <code>{`\"${schema.const}\"`}</code>\n </div>\n )}\n {(schema.minLength !== undefined || schema.maxLength !== undefined) && (\n <div className={cn('mint:prose mint:prose-sm mint:prose-gray mint:dark:prose-invert', description && 'mint:mt-6')}>\n <StringLength minLength={schema.minLength} maxLength={schema.maxLength} />\n </div>\n )}\n </>\n );\n};\n\nconst StringLength = ({ minLength, maxLength }: { minLength?: number; maxLength?: number }) => {\n if (minLength === maxLength && minLength !== undefined) {\n return (\n <>\n Required string length: <code>{minLength}</code>\n </>\n );\n }\n if (minLength && maxLength) {\n return (\n <>\n Required string length: <code>{`${minLength} - ${maxLength}`}</code>\n </>\n );\n }\n if (minLength) {\n return (\n <>\n Minimum length: <code>{minLength}</code>\n </>\n );\n }\n if (maxLength) {\n return (\n <>\n Maximum length: <code>{maxLength}</code>\n </>\n );\n }\n return '';\n};\n"],"names":["StringMetadata","schema","description","jsxs","Fragment","cn","jsx","StringLength","minLength","maxLength"],"mappings":";;;AAMO,MAAMA,IAAiB,CAAC;AAAA,EAC7B,QAAAC;AAAA,EACA,aAAAC;AACF,MAKI,gBAAAC,EAAAC,GAAA,EACG,UAAA;AAAA,EAAAH,EAAO,UAAU,UAChB,gBAAAE,EAAC,OAAA,EAAI,WAAWE,EAAG,mEAAmEH,KAAe,WAAW,GAAG,UAAA;AAAA,IAAA;AAAA,IAClG,gBAAAI,EAAC,QAAA,EAAM,UAAA,IAAIL,EAAO,KAAK,IAAA,CAAI;AAAA,EAAA,GAC5C;AAAA,GAEAA,EAAO,cAAc,UAAaA,EAAO,cAAc,WACvD,gBAAAK,EAAC,OAAA,EAAI,WAAWD,EAAG,mEAAmEH,KAAe,WAAW,GAC9G,4BAACK,GAAA,EAAa,WAAWN,EAAO,WAAW,WAAWA,EAAO,UAAA,CAAW,EAAA,CAC1E;AAAA,GAEJ,GAIEM,IAAe,CAAC,EAAE,WAAAC,GAAW,WAAAC,QAC7BD,MAAcC,KAAaD,MAAc,SAEzC,gBAAAL,EAAAC,GAAA,EAAE,UAAA;AAAA,EAAA;AAAA,EACwB,gBAAAE,EAAC,UAAM,UAAAE,EAAA,CAAU;AAAA,GAC3C,IAGAA,KAAaC,IAEb,gBAAAN,EAAAC,GAAA,EAAE,UAAA;AAAA,EAAA;AAAA,oBACyB,QAAA,EAAM,UAAA,GAAGI,CAAS,MAAMC,CAAS,GAAA,CAAG;AAAA,GAC/D,IAGAD,IAEA,gBAAAL,EAAAC,GAAA,EAAE,UAAA;AAAA,EAAA;AAAA,EACgB,gBAAAE,EAAC,UAAM,UAAAE,EAAA,CAAU;AAAA,GACnC,IAGAC,IAEA,gBAAAN,EAAAC,GAAA,EAAE,UAAA;AAAA,EAAA;AAAA,EACgB,gBAAAE,EAAC,UAAM,UAAAG,EAAA,CAAU;AAAA,GACnC,IAGG;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/api-playground/EndpointFields/ParamFields/PrimitiveParamField/index.tsx"],"sourcesContent":["'use client';\n\nimport {\n AnySchema,\n BooleanSchema,\n DataSchema,\n DataSchemaArray,\n FileSchema,\n IncrementalDataSchema,\n IncrementalDataSchemaArray,\n NullSchema,\n NumberEnumSchema,\n NumberSchema,\n StringEnumSchema,\n StringSchema,\n} from '@mintlify/validation';\n\nimport { ParamHead } from '@/components/Api/Param';\nimport { cn } from '@/api-playground-2/schemaGraph/utils';\n\nimport { Description } from '../../components/Description';\nimport { ExampleDescription } from '../ExampleDescription';\nimport { EnumConstTable, EnumOptions } from './Enum';\nimport { NumberMetadata } from './NumberMetadata';\nimport { StringMetadata } from './StringMetadata';\nimport { FieldType } from '@/api-playground-2/types/api';\n\nexport type PrimitiveParamFieldParams = {\n fieldType: FieldType;\n schema:\n | BooleanSchema\n | StringSchema\n | NumberSchema\n | StringEnumSchema\n | NumberEnumSchema\n | FileSchema\n | NullSchema\n | AnySchema;\n schemaArray?: DataSchemaArray | IncrementalDataSchemaArray;\n typeOptions: string[];\n name?: string | null;\n location?: string;\n selectedIndex?: number;\n onSelectTypeOption?: (index: number) => void;\n parentName?: string;\n paramId?: string;\n style?: string;\n explode?: boolean;\n};\n\nexport const PrimitiveParamField = ({\n fieldType,\n schema,\n schemaArray,\n name,\n location,\n typeOptions,\n selectedIndex,\n onSelectTypeOption,\n parentName,\n paramId,\n style,\n explode,\n}: PrimitiveParamFieldParams) => {\n const typeLabel = typeOptions[selectedIndex ?? 0];\n\n const description =\n schema.description ??\n (name === undefined ? `The ${fieldType} is of type \\`${typeLabel}\\`.` : undefined);\n\n return (\n <div className=\"mint:py-6\">\n <ParamHead\n id={paramId}\n name={name}\n typeLabel={typeLabel}\n location={location}\n fieldType={fieldType}\n required={schema.required}\n deprecated={schema.deprecated}\n defaultValue={schema.default}\n typeOptions={typeOptions}\n selectedTypeOptionIndex={selectedIndex}\n onSelectTypeOption={onSelectTypeOption}\n parentName={parentName}\n style={style}\n explode={explode}\n />\n <div className={cn({ 'mint:mt-4': description || isEnum(schema) })}>\n {description && <Description markdown={description} />}\n {schemaArray && isEnumWithConsts(schemaArray) ? (\n <EnumConstTable schemaArray={schemaArray} />\n ) : (\n isEnum(schema) && <EnumOptions schema={schema} />\n )}\n {isStringSchema(schema) && <StringMetadata schema={schema} description={description} />}\n {isNumberSchema(schema) && <NumberMetadata schema={schema} />}\n <ExampleDescription schema={schema} />\n </div>\n </div>\n );\n};\n\nexport const isEnum = (\n schema: DataSchema | IncrementalDataSchema\n): schema is NumberEnumSchema | StringEnumSchema => {\n return (\n schema.type === 'enum<integer>' ||\n schema.type === 'enum<number>' ||\n schema.type === 'enum<string>'\n );\n};\n\nexport const isEnumWithConsts = (\n schemaArray?: DataSchemaArray | IncrementalDataSchemaArray\n): boolean => {\n if (!schemaArray) return false;\n return schemaArray.some((schema) => isEnum(schema) && 'const' in schema);\n};\n\nconst isStringSchema = (schema: DataSchema | IncrementalDataSchema): schema is StringSchema => {\n return schema.type === 'string';\n};\n\nconst isNumberSchema = (schema: DataSchema | IncrementalDataSchema): schema is NumberSchema => {\n return schema.type === 'number' || schema.type === 'integer';\n};\n"],"names":["isEnum","schema"],"mappings":";AAuGO,MAAMA,IAAS,CACpBC,MAGEA,EAAO,SAAS,mBAChBA,EAAO,SAAS,kBAChBA,EAAO,SAAS;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import "react/jsx-runtime";
|
|
2
|
+
import $ from "@sindresorhus/slugify";
|
|
3
|
+
const c = (r, e, t, i) => $(
|
|
4
|
+
`${r ? `${r}-` : ""}${t ? `${t}-` : ""}${e || ""}-`,
|
|
5
|
+
{
|
|
6
|
+
decamelize: !0
|
|
7
|
+
}
|
|
8
|
+
), s = (r, e) => r ? `${e ? `${e}` : ""}${r}.` : "";
|
|
9
|
+
export {
|
|
10
|
+
c as buildRecursiveParamFieldId,
|
|
11
|
+
s as getRecursiveParentName
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=RecursiveParamField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RecursiveParamField.js","sources":["../../../../src/api-playground/EndpointFields/ParamFields/RecursiveParamField.tsx"],"sourcesContent":["'use client';\n\nimport { DataSchema, DataSchemaArray, IncrementalDataSchemaArray } from '@mintlify/validation';\nimport slugify from '@sindresorhus/slugify';\n\nimport { useEndpointLocation } from '@/contexts/EndpointLocationContext';\nimport { getConstFilteredSchemaArray } from '@/openapi/filterEnums';\nimport {\n getAuthFilteredSchemaArray,\n isDataSchemaArrayOrIncrementalDataSchemaArray,\n} from '@/openapi/getAuthFilteredSchemaArray';\nimport { getNextPropertiesByType } from '@/utils/api-reference/getNextPropertiesByType';\n\nimport { RecursiveParamFieldWithChildrenObserver } from './RecursiveParamFieldWithChildrenObserver';\nimport { RecursiveParamFieldWithObserver } from './RecursiveParamFieldWithObserver';\nimport { FieldType, RenderedRefs } from '@/api-playground-2/types/api';\n\nexport type RecursiveParamFieldParams = {\n fieldType: FieldType;\n schemaArray: DataSchemaArray | IncrementalDataSchemaArray;\n renderedRefs?: RenderedRefs;\n name?: string | null;\n location?: string;\n parentName?: string;\n depth?: number;\n hideDescription?: boolean;\n circularRefs?: string[];\n paramId?: string;\n style?: string;\n explode?: boolean;\n};\n\nexport const RecursiveParamField = ({\n fieldType,\n schemaArray,\n name,\n location,\n parentName,\n depth = 0,\n hideDescription = false,\n renderedRefs = new Set(),\n circularRefs,\n paramId,\n style,\n explode,\n}: RecursiveParamFieldParams) => {\n const { anchor } = useEndpointLocation();\n let filteredSchemaArray: DataSchemaArray | IncrementalDataSchemaArray | null = schemaArray;\n filteredSchemaArray = getAuthFilteredSchemaArray({ schemaArray, userGroups: undefined });\n\n if (\n filteredSchemaArray &&\n filteredSchemaArray.some((schema) => 'enum' in schema && 'const' in schema)\n ) {\n filteredSchemaArray = getConstFilteredSchemaArray({ schemaArray });\n }\n\n if (!isDataSchemaArrayOrIncrementalDataSchemaArray(filteredSchemaArray)) {\n return null;\n }\n\n const RecursiveParamFieldType = anchor\n ? RecursiveParamFieldWithChildrenObserver\n : RecursiveParamFieldWithObserver;\n\n return (\n <RecursiveParamFieldType\n fieldType={fieldType}\n schemaArray={filteredSchemaArray}\n name={name}\n location={location}\n parentName={parentName}\n depth={depth}\n style={style}\n explode={explode}\n hideDescription={hideDescription}\n renderedRefs={renderedRefs}\n circularRefs={circularRefs}\n paramId={paramId}\n />\n );\n};\n\ntype RenderNextPropertiesRecursivelyParams = {\n properties: [string, DataSchemaArray | IncrementalDataSchemaArray][];\n fieldType: FieldType;\n depth: number;\n refs: Set<string>;\n parentName?: string;\n name?: string | null;\n currentSchemaRef: string | undefined;\n style?: string;\n explode?: boolean;\n hideParentName?: boolean;\n};\n\nexport const renderNextPropertiesRecursively = ({\n currentSchemaRef,\n properties,\n fieldType,\n parentName,\n name,\n depth,\n refs,\n style,\n explode,\n hideParentName,\n}: RenderNextPropertiesRecursivelyParams) => {\n // Create a new set with the current refs for this level\n const currentLevelRefs = new Set(refs);\n\n if (currentSchemaRef) {\n currentLevelRefs.add(currentSchemaRef);\n }\n\n if (currentLevelRefs.size > 0) {\n return properties.map((property) => {\n const [propertyName, schemaArray] = property;\n const nextSchemaArray = schemaArray[0];\n const nextSchemaArrayProperties = getNextPropertiesByType(nextSchemaArray);\n const paramId = buildRecursiveParamFieldId(fieldType, name, parentName, propertyName);\n const passedName = hideParentName ? '' : name;\n let circularReferences: string[] = [];\n if (\n Object.values(nextSchemaArrayProperties).some(\n (value: unknown) => typeof value === 'string' && currentLevelRefs.has(value)\n )\n ) {\n circularReferences = Object.values(nextSchemaArrayProperties).filter(\n (value: unknown) => typeof value === 'string' && currentLevelRefs.has(value)\n );\n }\n return (\n <RecursiveParamField\n paramId={paramId}\n fieldType={fieldType}\n key={propertyName}\n schemaArray={schemaArray}\n name={propertyName}\n parentName={\n style === 'deepObject' && explode\n ? getDeepObjectParentName(passedName, parentName)\n : getRecursiveParentName(passedName, parentName)\n }\n depth={depth + 1}\n renderedRefs={new Set(currentLevelRefs)}\n circularRefs={circularReferences}\n style={style}\n explode={explode}\n />\n );\n });\n } else {\n return properties.map(([propertyName, schemaArray]) => {\n const paramId = buildRecursiveParamFieldId(fieldType, name, parentName, propertyName);\n const passedName = hideParentName ? '' : name;\n return (\n <RecursiveParamField\n paramId={paramId}\n fieldType={fieldType}\n key={propertyName}\n schemaArray={schemaArray}\n name={propertyName}\n parentName={\n style === 'deepObject' && explode\n ? getDeepObjectParentName(passedName, parentName)\n : getRecursiveParentName(passedName, parentName)\n }\n depth={depth + 1}\n renderedRefs={new Set()}\n style={style}\n explode={explode}\n />\n );\n });\n }\n};\n\ntype RenderTruncatedNextPropertiesParams = {\n properties: [string, DataSchemaArray | IncrementalDataSchemaArray][];\n fieldType: FieldType;\n parentName?: string;\n name?: string | null;\n depth: number;\n};\n\nexport const renderTruncatedNextProperties = ({\n properties,\n fieldType,\n parentName,\n name,\n depth,\n}: RenderTruncatedNextPropertiesParams) => {\n return properties.map((property) => {\n const [propertyName, schemaArray] = property;\n const nextSchemaArray = schemaArray[0];\n const baseSchema: DataSchema = nextSchemaArray as DataSchema;\n if (baseSchema.type === 'array') {\n baseSchema.items = [{ type: 'any' }];\n } else if (baseSchema.type === 'object') {\n baseSchema.properties = {};\n }\n const paramId = buildRecursiveParamFieldId(fieldType, name, parentName);\n const id = `${paramId}-${propertyName}`;\n return (\n <RecursiveParamField\n fieldType={fieldType}\n key={propertyName}\n schemaArray={[baseSchema]}\n name={propertyName}\n paramId={id}\n depth={depth + 1}\n renderedRefs={new Set()}\n />\n );\n });\n};\n\nexport const buildRecursiveParamFieldId = (\n fieldType: FieldType | undefined,\n name: string | undefined | null,\n parentName: string | undefined,\n propertyName?: string | undefined\n) => {\n return slugify(\n `${fieldType ? `${fieldType}-` : ''}${parentName ? `${parentName}-` : ''}${name ? name : ''}-${propertyName ? propertyName : ''}`,\n {\n decamelize: true,\n }\n );\n};\n\nexport const getRecursiveParentName = (name?: string | null, parentName?: string): string => {\n if (!name) {\n return '';\n }\n\n return `${parentName ? `${parentName}` : ''}${name}.`;\n};\n\nexport const getDeepObjectParentName = (name?: string | null, parentName?: string): string => {\n if (!name) {\n return '';\n }\n\n return parentName ? `${parentName}${name}][` : `${name}[`;\n};\n"],"names":["buildRecursiveParamFieldId","fieldType","name","parentName","propertyName","slugify","getRecursiveParentName"],"mappings":";;AA0NO,MAAMA,IAA6B,CACxCC,GACAC,GACAC,GACAC,MAEOC;AAAA,EACL,GAAGJ,IAAY,GAAGA,CAAS,MAAM,EAAE,GAAGE,IAAa,GAAGA,CAAU,MAAM,EAAE,GAAGD,KAAc,EAAE;AAAA,EAC3F;AAAA,IACE,YAAY;AAAA,EAAA;AACd,GAISI,IAAyB,CAACJ,GAAsBC,MACtDD,IAIE,GAAGC,IAAa,GAAGA,CAAU,KAAK,EAAE,GAAGD,CAAI,MAHzC;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { MarkdownWithoutHeaders as e, Markdown as o } from "../../../components/Api/Markdown.js";
|
|
3
|
+
import "@mintlify/validation";
|
|
4
|
+
import { cn as t } from "../../../utils/cn.js";
|
|
5
|
+
const l = ({ markdown: n, className: i }) => /* @__PURE__ */ r("div", { className: t("mint:prose mint:prose-sm mint:prose-gray mint:dark:prose-invert mint:max-w-none mint:w-full mint:col-span-full", i), children: /* @__PURE__ */ r(o, { children: n }) }), c = ({
|
|
6
|
+
markdown: n,
|
|
7
|
+
className: i
|
|
8
|
+
}) => /* @__PURE__ */ r("div", { className: t("mint:prose mint:prose-sm mint:prose-gray mint:dark:prose-invert mint:max-w-none mint:w-full", i), children: /* @__PURE__ */ r(e, { children: n }) });
|
|
9
|
+
export {
|
|
10
|
+
l as Description,
|
|
11
|
+
c as DescriptionWithoutHeaders
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=Description.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Description.js","sources":["../../../../src/api-playground/EndpointFields/components/Description.tsx"],"sourcesContent":["'use client';\n\nimport { Markdown, MarkdownWithoutHeaders } from '../../../components/Api/Markdown';\nimport { cn } from '@/api-playground-2/schemaGraph/utils';\n\nexport const Description = ({ markdown, className }: { markdown: string; className?: string }) => {\n return (\n <div className={cn('mint:prose mint:prose-sm mint:prose-gray mint:dark:prose-invert mint:max-w-none mint:w-full mint:col-span-full', className)}>\n <Markdown>{markdown}</Markdown>\n </div>\n );\n};\n\nexport const DescriptionWithoutHeaders = ({\n markdown,\n className,\n}: {\n markdown: string;\n className?: string;\n}) => {\n return (\n <div className={cn('mint:prose mint:prose-sm mint:prose-gray mint:dark:prose-invert mint:max-w-none mint:w-full', className)}>\n <MarkdownWithoutHeaders>{markdown}</MarkdownWithoutHeaders>\n </div>\n );\n};\n"],"names":["Description","markdown","className","jsx","cn","Markdown","DescriptionWithoutHeaders","MarkdownWithoutHeaders"],"mappings":";;;;AAKO,MAAMA,IAAc,CAAC,EAAE,UAAAC,GAAU,WAAAC,QAEpC,gBAAAC,EAAC,OAAA,EAAI,WAAWC,EAAG,kHAAkHF,CAAS,GAC5I,UAAA,gBAAAC,EAACE,GAAA,EAAU,UAAAJ,EAAA,CAAS,EAAA,CACtB,GAISK,IAA4B,CAAC;AAAA,EACxC,UAAAL;AAAA,EACA,WAAAC;AACF,MAKI,gBAAAC,EAAC,OAAA,EAAI,WAAWC,EAAG,+FAA+FF,CAAS,GACzH,UAAA,gBAAAC,EAACI,GAAA,EAAwB,UAAAN,EAAA,CAAS,EAAA,CACpC;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { Tabs as a } from "../../../components/content-components/tabs/tabs.js";
|
|
3
|
+
import { Tab as n } from "../../../components/content-components/tabs/tab.js";
|
|
4
|
+
const b = ({
|
|
5
|
+
options: e,
|
|
6
|
+
selectedIndex: t,
|
|
7
|
+
onSelectOption: i
|
|
8
|
+
}) => /* @__PURE__ */ m("div", { className: "mint:-mt-2", children: /* @__PURE__ */ m(
|
|
9
|
+
a,
|
|
10
|
+
{
|
|
11
|
+
defaultTabIndex: t,
|
|
12
|
+
onClickTab: i,
|
|
13
|
+
className: "mint:border-gray-100! mint:mb-4! mint:dark:border-white/10!",
|
|
14
|
+
children: e.map((r) => /* @__PURE__ */ m(n, { title: r }, r))
|
|
15
|
+
}
|
|
16
|
+
) });
|
|
17
|
+
export {
|
|
18
|
+
b as OneOfSelection
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=OneOfDropdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OneOfDropdown.js","sources":["../../../../src/api-playground/EndpointFields/components/OneOfDropdown.tsx"],"sourcesContent":["'use client';\n\nimport { Tab, Tabs } from '@/components/content-components/tabs';\nimport { cn } from \"../../../utils/cn\";\n\nexport const OneOfSelection = ({\n options,\n selectedIndex,\n onSelectOption,\n}: {\n options: string[];\n selectedIndex?: number;\n onSelectOption?: (index: number) => void;\n}) => (\n <div className=\"mint:-mt-2\">\n <Tabs\n defaultTabIndex={selectedIndex}\n onClickTab={onSelectOption}\n className=\"mint:border-gray-100! mint:mb-4! mint:dark:border-white/10!\"\n >\n {options.map((option) => (\n <Tab title={option} key={option} />\n ))}\n </Tabs>\n </div>\n);\n"],"names":["OneOfSelection","options","selectedIndex","onSelectOption","jsx","Tabs","option","Tab"],"mappings":";;;AAKO,MAAMA,IAAiB,CAAC;AAAA,EAC7B,SAAAC;AAAA,EACA,eAAAC;AAAA,EACA,gBAAAC;AACF,MAKE,gBAAAC,EAAC,OAAA,EAAI,WAAU,cACb,UAAA,gBAAAA;AAAA,EAACC;AAAA,EAAA;AAAA,IACC,iBAAiBH;AAAA,IACjB,YAAYC;AAAA,IACZ,WAAU;AAAA,IAET,UAAAF,EAAQ,IAAI,CAACK,wBACXC,GAAA,EAAI,OAAOD,EAAA,GAAaA,CAAQ,CAClC;AAAA,EAAA;AACH,EAAA,CACF;"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useSelectedLocale as s } from "../../../utils/locales/index.js";
|
|
3
|
+
import { Classes as d } from "../../../api-playground-2/types/index.js";
|
|
4
|
+
import "@mintlify/validation";
|
|
5
|
+
import { cn as m } from "../../../utils/cn.js";
|
|
6
|
+
const f = ({
|
|
7
|
+
options: r,
|
|
8
|
+
selectedIndex: a,
|
|
9
|
+
onSelectOption: e,
|
|
10
|
+
noBackground: o
|
|
11
|
+
}) => {
|
|
12
|
+
const l = s();
|
|
13
|
+
return /* @__PURE__ */ t("div", { className: m(d.OptionDropdown, "mint:inline-flex mint:relative mint:mr-0!"), children: /* @__PURE__ */ t(
|
|
14
|
+
"div",
|
|
15
|
+
{
|
|
16
|
+
className: m(
|
|
17
|
+
"mint:font-mono mint:text-xs mint:font-medium mint:inline-block! mint:leading-4! mint:items-center mint:rounded-md mint:text-gray-600 mint:dark:text-gray-200 mint:py-0.5",
|
|
18
|
+
!o && "mint:bg-gray-100/50 mint:dark:bg-white/5"
|
|
19
|
+
),
|
|
20
|
+
children: /* @__PURE__ */ t(
|
|
21
|
+
"select",
|
|
22
|
+
{
|
|
23
|
+
"aria-label": l["aria.selectSchemaType"],
|
|
24
|
+
className: "mint:flex mint:bg-transparent mint:focus:outline-0 mint:cursor-pointer mint:text-start mint:pl-0 mint:pr-0 mint:hover:text-gray-950 mint:dark:hover:text-white",
|
|
25
|
+
onChange: (i) => e == null ? void 0 : e(i.target.selectedIndex),
|
|
26
|
+
value: a,
|
|
27
|
+
children: r.map((i, n) => /* @__PURE__ */ t("option", { value: n, children: i }, n))
|
|
28
|
+
}
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
) });
|
|
32
|
+
};
|
|
33
|
+
export {
|
|
34
|
+
f as OptionDropdown
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=OptionDropdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OptionDropdown.js","sources":["../../../../src/api-playground/EndpointFields/components/OptionDropdown.tsx"],"sourcesContent":["'use client';\n\nimport { useSelectedLocale } from '@/utils/locales';\nimport { Classes } from '@/api-playground-2/types';\nimport { cn } from '@/api-playground-2/schemaGraph/utils';\n\nexport const OptionDropdown = ({\n options,\n selectedIndex,\n onSelectOption,\n noBackground,\n}: {\n options: string[];\n selectedIndex?: number;\n onSelectOption?: (index: number) => void;\n noBackground?: boolean;\n}) => {\n const locale = useSelectedLocale();\n return (\n <div className={cn(Classes.OptionDropdown, 'mint:inline-flex mint:relative mint:mr-0!')}>\n <div\n className={cn(\n 'mint:font-mono mint:text-xs mint:font-medium mint:inline-block! mint:leading-4! mint:items-center mint:rounded-md mint:text-gray-600 mint:dark:text-gray-200 mint:py-0.5',\n !noBackground && 'mint:bg-gray-100/50 mint:dark:bg-white/5'\n )}\n >\n <select\n aria-label={locale['aria.selectSchemaType']}\n className=\"mint:flex mint:bg-transparent mint:focus:outline-0 mint:cursor-pointer mint:text-start mint:pl-0 mint:pr-0 mint:hover:text-gray-950 mint:dark:hover:text-white\"\n onChange={(e) => onSelectOption?.(e.target.selectedIndex)}\n value={selectedIndex}\n >\n {options.map((option, index) => (\n <option value={index} key={index}>\n {option}\n </option>\n ))}\n </select>\n </div>\n </div>\n );\n};\n"],"names":["OptionDropdown","options","selectedIndex","onSelectOption","noBackground","locale","useSelectedLocale","cn","Classes","jsx","e","option","index"],"mappings":";;;;;AAMO,MAAMA,IAAiB,CAAC;AAAA,EAC7B,SAAAC;AAAA,EACA,eAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,cAAAC;AACF,MAKM;AACJ,QAAMC,IAASC,EAAA;AACf,2BACG,OAAA,EAAI,WAAWC,EAAGC,EAAQ,gBAAgB,2CAA2C,GACpF,UAAA,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWF;AAAA,QACT;AAAA,QACA,CAACH,KAAgB;AAAA,MAAA;AAAA,MAGnB,UAAA,gBAAAK;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,cAAYJ,EAAO,uBAAuB;AAAA,UAC1C,WAAU;AAAA,UACV,UAAU,CAACK,MAAMP,KAAA,gBAAAA,EAAiBO,EAAE,OAAO;AAAA,UAC3C,OAAOR;AAAA,UAEN,UAAAD,EAAQ,IAAI,CAACU,GAAQC,MACpB,gBAAAH,EAAC,UAAA,EAAO,OAAOG,GACZ,UAAAD,EAAA,GADwBC,CAE3B,CACD;AAAA,QAAA;AAAA,MAAA;AAAA,IACH;AAAA,EAAA,GAEJ;AAEJ;"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsxs as o, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { Classes as m } from "../../../api-playground-2/types/index.js";
|
|
3
|
+
import "@mintlify/validation";
|
|
4
|
+
import { cn as e } from "../../../utils/cn.js";
|
|
5
|
+
import { Description as c } from "./Description.js";
|
|
6
|
+
import { OptionDropdown as p } from "./OptionDropdown.js";
|
|
7
|
+
const v = ({
|
|
8
|
+
title: a,
|
|
9
|
+
subtitle: r,
|
|
10
|
+
rightElement: n,
|
|
11
|
+
options: t,
|
|
12
|
+
selectedIndex: s,
|
|
13
|
+
onSelectOption: d,
|
|
14
|
+
children: l
|
|
15
|
+
}) => /* @__PURE__ */ o("div", { className: e(m.APISectionHeading, "mint:flex mint:flex-col mint:gap-y-4 mint:w-full"), children: [
|
|
16
|
+
/* @__PURE__ */ o("div", { className: "mint:flex mint:items-baseline mint:border-b mint:pb-2.5 mint:border-gray-100 mint:dark:border-gray-800 mint:w-full", children: [
|
|
17
|
+
/* @__PURE__ */ i("h4", { className: e(m.APISectionHeadingTitle, "mint:flex-1 mint:mb-0"), children: a }),
|
|
18
|
+
t && t.length > 1 && /* @__PURE__ */ i(
|
|
19
|
+
p,
|
|
20
|
+
{
|
|
21
|
+
options: t,
|
|
22
|
+
selectedIndex: s,
|
|
23
|
+
onSelectOption: d,
|
|
24
|
+
noBackground: !0
|
|
25
|
+
}
|
|
26
|
+
),
|
|
27
|
+
/* @__PURE__ */ i("div", { className: "mint:flex mint:items-center", children: n && (typeof n == "string" ? /* @__PURE__ */ i("div", { className: "mint:font-mono mint:px-2 mint:py-0.5 mint:text-xs mint:font-medium mint:text-gray-600 mint:dark:text-gray-300", children: n }) : n) })
|
|
28
|
+
] }),
|
|
29
|
+
l,
|
|
30
|
+
r && /* @__PURE__ */ i(
|
|
31
|
+
"div",
|
|
32
|
+
{
|
|
33
|
+
className: e(
|
|
34
|
+
m.APISectionHeadingSubtitle,
|
|
35
|
+
"mint:text-sm mint:prose mint:prose-gray mint:dark:prose-invert mint:mb-2"
|
|
36
|
+
),
|
|
37
|
+
children: /* @__PURE__ */ i(c, { markdown: r })
|
|
38
|
+
}
|
|
39
|
+
)
|
|
40
|
+
] });
|
|
41
|
+
export {
|
|
42
|
+
v as SectionHeading
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=SectionHeading.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SectionHeading.js","sources":["../../../../src/api-playground/EndpointFields/components/SectionHeading.tsx"],"sourcesContent":["'use client';\n\nimport { ReactNode } from 'react';\n\nimport { Classes } from '@/api-playground-2/types';\nimport { cn } from '@/api-playground-2/schemaGraph/utils';\n\nimport { Description } from './Description';\nimport { OptionDropdown } from './OptionDropdown';\n\ntype SectionHeadingProps = {\n title: string;\n subtitle?: string;\n rightElement?: string | ReactNode;\n options?: string[];\n selectedIndex?: number;\n onSelectOption?: (index: number) => void;\n onToggleExpand?: () => void;\n children?: ReactNode;\n};\n\nexport const SectionHeading = ({\n title,\n subtitle,\n rightElement,\n options,\n selectedIndex,\n onSelectOption,\n children,\n}: SectionHeadingProps) => {\n return (\n <div className={cn(Classes.APISectionHeading, 'mint:flex mint:flex-col mint:gap-y-4 mint:w-full')}>\n <div className=\"mint:flex mint:items-baseline mint:border-b mint:pb-2.5 mint:border-gray-100 mint:dark:border-gray-800 mint:w-full\">\n <h4 className={cn(Classes.APISectionHeadingTitle, 'mint:flex-1 mint:mb-0')}>{title}</h4>\n {options && options.length > 1 && (\n <OptionDropdown\n options={options}\n selectedIndex={selectedIndex}\n onSelectOption={onSelectOption}\n noBackground\n />\n )}\n <div className=\"mint:flex mint:items-center\">\n {rightElement &&\n (typeof rightElement === 'string' ? (\n <div className=\"mint:font-mono mint:px-2 mint:py-0.5 mint:text-xs mint:font-medium mint:text-gray-600 mint:dark:text-gray-300\">\n {rightElement}\n </div>\n ) : (\n rightElement\n ))}\n </div>\n </div>\n {children}\n {subtitle && (\n <div\n className={cn(\n Classes.APISectionHeadingSubtitle,\n 'mint:text-sm mint:prose mint:prose-gray mint:dark:prose-invert mint:mb-2'\n )}\n >\n <Description markdown={subtitle} />\n </div>\n )}\n </div>\n );\n};\n"],"names":["SectionHeading","title","subtitle","rightElement","options","selectedIndex","onSelectOption","children","cn","Classes","jsxs","jsx","OptionDropdown","Description"],"mappings":";;;;;;AAqBO,MAAMA,IAAiB,CAAC;AAAA,EAC7B,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,cAAAC;AAAA,EACA,SAAAC;AAAA,EACA,eAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,UAAAC;AACF,wBAEK,OAAA,EAAI,WAAWC,EAAGC,EAAQ,mBAAmB,kDAAkD,GAC9F,UAAA;AAAA,EAAA,gBAAAC,EAAC,OAAA,EAAI,WAAU,sHACb,UAAA;AAAA,IAAA,gBAAAC,EAAC,QAAG,WAAWH,EAAGC,EAAQ,wBAAwB,uBAAuB,GAAI,UAAAR,GAAM;AAAA,IAClFG,KAAWA,EAAQ,SAAS,KAC3B,gBAAAO;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,SAAAR;AAAA,QACA,eAAAC;AAAA,QACA,gBAAAC;AAAA,QACA,cAAY;AAAA,MAAA;AAAA,IAAA;AAAA,IAGhB,gBAAAK,EAAC,OAAA,EAAI,WAAU,+BACZ,gBACE,OAAOR,KAAiB,WACvB,gBAAAQ,EAAC,OAAA,EAAI,WAAU,iHACZ,UAAAR,EAAA,CACH,IAEAA,GAAA,CAEN;AAAA,EAAA,GACF;AAAA,EACCI;AAAA,EACAL,KACC,gBAAAS;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWH;AAAA,QACTC,EAAQ;AAAA,QACR;AAAA,MAAA;AAAA,MAGF,UAAA,gBAAAE,EAACE,GAAA,EAAY,UAAUX,EAAA,CAAU;AAAA,IAAA;AAAA,EAAA;AACnC,GAEJ;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/api-playground/EndpointFields/index.tsx"],"sourcesContent":["'use client';\n\nimport { EndpointLocationProvider } from '@/contexts/EndpointLocationContext';\nimport { useOpenApiEndpoint } from '@/hooks/useEndpoint';\nimport { getFilteredSecurityOptions } from '@/utils/api-reference/getFilteredSecurityOptions';\n\nimport { EndpointBody } from './EndpointBody';\nimport { EndpointParameters } from './EndpointParameters';\nimport { EndpointResponse } from './EndpointResponse';\nimport { EndpointSecurity } from './EndpointSecurity';\n\nconst EndpointFields = () => {\n const endpoint = useOpenApiEndpoint();\n const newApiReferencePage = true;\n\n if (endpoint === undefined || newApiReferencePage) {\n return null;\n }\n\n // TODO(ronan): remove when all security options are handled (none should be empty)\n const filteredSecurityOptions = getFilteredSecurityOptions(endpoint);\n\n return (\n <>\n {filteredSecurityOptions.length > 0 && (\n <EndpointSecurity securityOptions={filteredSecurityOptions} />\n )}\n <EndpointParameters parameters={endpoint.request.parameters} />\n <EndpointLocationProvider location=\"request\">\n <EndpointBody body={endpoint.request.body} />\n </EndpointLocationProvider>\n <EndpointLocationProvider location=\"response\">\n {Object.entries(endpoint.response)[0] && <EndpointResponse response={endpoint.response} />}\n </EndpointLocationProvider>\n </>\n );\n};\n\nexport default EndpointFields;\n"],"names":["EndpointFields","useOpenApiEndpoint"],"mappings":";;AAWA,MAAMA,IAAiB,OACJC,EAAA,GAIR;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useContext as o } from "react";
|
|
3
|
+
import { ApiReferenceContext2 as a } from "../contexts/ConfigContext.js";
|
|
4
|
+
import { OperationPage as i } from "./OperationPage.js";
|
|
5
|
+
import { SchemaPage as n } from "./SchemaPage.js";
|
|
6
|
+
const u = ({ children: r }) => {
|
|
7
|
+
const { apiReferenceData2: e } = o(a);
|
|
8
|
+
return e.operation ? /* @__PURE__ */ t(i, { apiReferenceData: e, operation: e.operation, children: r }) : e.schemaData ? /* @__PURE__ */ t(n, { apiReferenceData: e, children: r }) : null;
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
u as Api
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=Api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Api.js","sources":["../../src/api-playground-2/Api.tsx"],"sourcesContent":["'use client';\n\nimport { ReactNode, useContext } from 'react';\n\nimport { ApiReferenceContext2 } from '@/contexts/ConfigContext';\n\nimport { OperationPage } from './OperationPage';\nimport { SchemaPage } from './SchemaPage';\n\nexport const Api = ({ children }: { children: ReactNode }) => {\n const { apiReferenceData2 } = useContext(ApiReferenceContext2);\n\n if (apiReferenceData2.operation) {\n return (\n <OperationPage apiReferenceData={apiReferenceData2} operation={apiReferenceData2.operation}>\n {children}\n </OperationPage>\n );\n }\n if (apiReferenceData2.schemaData) {\n return <SchemaPage apiReferenceData={apiReferenceData2}>{children}</SchemaPage>;\n }\n return null;\n};\n"],"names":["Api","children","apiReferenceData2","useContext","ApiReferenceContext2","OperationPage","jsx","SchemaPage"],"mappings":";;;;;AASO,MAAMA,IAAM,CAAC,EAAE,UAAAC,QAAwC;AAC5D,QAAM,EAAE,mBAAAC,EAAA,IAAsBC,EAAWC,CAAoB;AAE7D,SAAIF,EAAkB,8BAEjBG,GAAA,EAAc,kBAAkBH,GAAmB,WAAWA,EAAkB,WAC9E,UAAAD,GACH,IAGAC,EAAkB,aACb,gBAAAI,EAACC,GAAA,EAAW,kBAAkBL,GAAoB,UAAAD,EAAA,CAAS,IAE7D;AACT;"}
|
|
@@ -1,35 +1,36 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { useContext as
|
|
3
|
-
import { usePlaygroundInputsStore as
|
|
4
|
-
import { CodeExampleLabelContext as
|
|
5
|
-
import { ApiReferenceContext2 as
|
|
1
|
+
import { jsx as e, jsxs as f } from "react/jsx-runtime";
|
|
2
|
+
import { useContext as x, useState as d, useMemo as h } from "react";
|
|
3
|
+
import { usePlaygroundInputsStore as g, useSelectedSecurityOption as R } from "./hooks/usePlaygroundInputsStore.js";
|
|
4
|
+
import { CodeExampleLabelContext as v } from "../contexts/CodeExampleLabelContext.js";
|
|
5
|
+
import { ApiReferenceContext2 as y } from "../contexts/ConfigContext.js";
|
|
6
6
|
import C from "../components/Api/ErrorBoundary.js";
|
|
7
7
|
import { clsx as S } from "clsx";
|
|
8
|
-
import { RequestExample as
|
|
9
|
-
import { ResponseExample as
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
import { RequestExample as D } from "./components/Example/RequestExample.js";
|
|
9
|
+
import { ResponseExample as E } from "./components/Example/ResponseExample.js";
|
|
10
|
+
import { initialApiPlaygroundInputs as w } from "./constants/index.js";
|
|
11
|
+
const F = ({ className: t, isModal: r = !1, apiReferenceData: n, noInputs: o = !1 }) => {
|
|
12
|
+
const { apiReferenceData2: m } = x(y), i = n || m, { getApiPlaygroundInputs: a } = g(), { selectedSecurityOptionIndex: s } = R(), p = a(), [l, c] = d(), u = h(
|
|
12
13
|
() => S(
|
|
13
14
|
"mint:w-full mint:xl:w-[28rem] mint:gap-6 mint:grid mint:grid-rows-[repeat(auto-fit,minmax(0,min-content))] mint:grid-rows mint:relative mint:max-h-[calc(100%-32px)] mint:min-h-[18rem]",
|
|
14
15
|
t
|
|
15
16
|
),
|
|
16
|
-
[t,
|
|
17
|
+
[t, r]
|
|
17
18
|
);
|
|
18
|
-
return /* @__PURE__ */ e(
|
|
19
|
+
return /* @__PURE__ */ e(v.Provider, { value: { selectedLabel: l, setSelectedLabel: c }, children: /* @__PURE__ */ e("div", { className: u, children: /* @__PURE__ */ f(C, { children: [
|
|
19
20
|
/* @__PURE__ */ e(
|
|
20
|
-
|
|
21
|
+
D,
|
|
21
22
|
{
|
|
22
|
-
selectedSecurityOptionIndex:
|
|
23
|
-
apiReferenceData:
|
|
24
|
-
inputs:
|
|
23
|
+
selectedSecurityOptionIndex: s,
|
|
24
|
+
apiReferenceData: i,
|
|
25
|
+
inputs: o ? w : p,
|
|
25
26
|
maxHeight: "mint:max-h-[40vh]"
|
|
26
27
|
}
|
|
27
28
|
),
|
|
28
|
-
/* @__PURE__ */ e(
|
|
29
|
+
/* @__PURE__ */ e(E, { apiReferenceData: i, maxHeight: "mint:max-h-[40vh]" })
|
|
29
30
|
] }) }) });
|
|
30
31
|
};
|
|
31
32
|
export {
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
F as ApiExamples,
|
|
34
|
+
F as default
|
|
34
35
|
};
|
|
35
36
|
//# sourceMappingURL=ApiExamples.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiExamples.js","sources":["../../src/api-playground-2/ApiExamples.tsx"],"sourcesContent":["'use client';\n\nimport React, { useContext, useMemo, useState } from 'react';\n\nimport { usePlaygroundInputsStore } from '@/api-playground-2/hooks/usePlaygroundInputsStore';\nimport { CodeExampleLabelContext } from '@/contexts/CodeExampleLabelContext';\nimport { ApiReferenceContext2 } from '@/contexts/ConfigContext';\nimport ErrorBoundary from '../components/Api/ErrorBoundary';\nimport { clsx } from 'clsx';\n\nimport { RequestExample } from './components/Example/RequestExample';\nimport { ResponseExample } from './components/Example/ResponseExample';\nimport { ApiReferenceDataV2 } from './types';\nimport { useSelectedSecurityOption } from './hooks/usePlaygroundInputsStore';\n\n\ntype ApiExamplesProps = {\n className?: string;\n isModal?: boolean;\n apiReferenceData?: ApiReferenceDataV2;\n};\n\nexport const ApiExamples = ({ className, isModal = false, apiReferenceData }: ApiExamplesProps) => {\n const { apiReferenceData2: apiReferenceData2FromContext } = useContext(ApiReferenceContext2);\n const apiReferenceData2 = apiReferenceData || apiReferenceData2FromContext;\n const { getApiPlaygroundInputs } = usePlaygroundInputsStore();\n const {selectedSecurityOptionIndex} = useSelectedSecurityOption();\n const inputs = getApiPlaygroundInputs();\n const [selectedLabel, setSelectedLabel] = useState<string | undefined>();\n\n const containerClassName = useMemo(\n () =>\n clsx(\n 'mint:w-full mint:xl:w-[28rem] mint:gap-6 mint:grid mint:grid-rows-[repeat(auto-fit,minmax(0,min-content))] mint:grid-rows mint:relative mint:max-h-[calc(100%-32px)] mint:min-h-[18rem]',\n className,\n ),\n [className, isModal]\n );\n\n return (\n <CodeExampleLabelContext.Provider value={{ selectedLabel, setSelectedLabel }}>\n <div className={containerClassName}>\n <ErrorBoundary>\n <RequestExample\n selectedSecurityOptionIndex={selectedSecurityOptionIndex}\n apiReferenceData={apiReferenceData2}\n inputs={inputs}\n maxHeight=\"mint:max-h-[40vh]\"\n />\n <ResponseExample apiReferenceData={apiReferenceData2} maxHeight=\"mint:max-h-[40vh]\" />\n {/* TODO - Api Playground Refactor: OpenApiSchemaExample */}\n </ErrorBoundary>\n </div>\n </CodeExampleLabelContext.Provider>\n );\n};\n\nexport default ApiExamples;\n"],"names":["ApiExamples","className","isModal","apiReferenceData","apiReferenceData2FromContext","useContext","ApiReferenceContext2","apiReferenceData2","getApiPlaygroundInputs","usePlaygroundInputsStore","selectedSecurityOptionIndex","useSelectedSecurityOption","inputs","selectedLabel","setSelectedLabel","useState","containerClassName","useMemo","clsx","jsx","CodeExampleLabelContext","ErrorBoundary","RequestExample","ResponseExample"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ApiExamples.js","sources":["../../src/api-playground-2/ApiExamples.tsx"],"sourcesContent":["'use client';\n\nimport React, { useContext, useMemo, useState } from 'react';\n\nimport { usePlaygroundInputsStore } from '@/api-playground-2/hooks/usePlaygroundInputsStore';\nimport { CodeExampleLabelContext } from '@/contexts/CodeExampleLabelContext';\nimport { ApiReferenceContext2 } from '@/contexts/ConfigContext';\nimport ErrorBoundary from '../components/Api/ErrorBoundary';\nimport { clsx } from 'clsx';\n\nimport { RequestExample } from './components/Example/RequestExample';\nimport { ResponseExample } from './components/Example/ResponseExample';\nimport { ApiReferenceDataV2 } from './types';\nimport { useSelectedSecurityOption } from './hooks/usePlaygroundInputsStore';\nimport { initialApiPlaygroundInputs } from './constants';\n\n\ntype ApiExamplesProps = {\n className?: string;\n isModal?: boolean;\n apiReferenceData?: ApiReferenceDataV2;\n noInputs?: boolean;\n};\n\nexport const ApiExamples = ({ className, isModal = false, apiReferenceData, noInputs = false }: ApiExamplesProps) => {\n const { apiReferenceData2: apiReferenceData2FromContext } = useContext(ApiReferenceContext2);\n const apiReferenceData2 = apiReferenceData || apiReferenceData2FromContext;\n const { getApiPlaygroundInputs } = usePlaygroundInputsStore();\n const {selectedSecurityOptionIndex} = useSelectedSecurityOption();\n const inputs = getApiPlaygroundInputs();\n const [selectedLabel, setSelectedLabel] = useState<string | undefined>();\n\n const containerClassName = useMemo(\n () =>\n clsx(\n 'mint:w-full mint:xl:w-[28rem] mint:gap-6 mint:grid mint:grid-rows-[repeat(auto-fit,minmax(0,min-content))] mint:grid-rows mint:relative mint:max-h-[calc(100%-32px)] mint:min-h-[18rem]',\n className,\n ),\n [className, isModal]\n );\n\n return (\n <CodeExampleLabelContext.Provider value={{ selectedLabel, setSelectedLabel }}>\n <div className={containerClassName}>\n <ErrorBoundary>\n <RequestExample\n selectedSecurityOptionIndex={selectedSecurityOptionIndex}\n apiReferenceData={apiReferenceData2}\n inputs={noInputs ? initialApiPlaygroundInputs : inputs}\n maxHeight=\"mint:max-h-[40vh]\"\n />\n <ResponseExample apiReferenceData={apiReferenceData2} maxHeight=\"mint:max-h-[40vh]\" />\n {/* TODO - Api Playground Refactor: OpenApiSchemaExample */}\n </ErrorBoundary>\n </div>\n </CodeExampleLabelContext.Provider>\n );\n};\n\nexport default ApiExamples;\n"],"names":["ApiExamples","className","isModal","apiReferenceData","noInputs","apiReferenceData2FromContext","useContext","ApiReferenceContext2","apiReferenceData2","getApiPlaygroundInputs","usePlaygroundInputsStore","selectedSecurityOptionIndex","useSelectedSecurityOption","inputs","selectedLabel","setSelectedLabel","useState","containerClassName","useMemo","clsx","jsx","CodeExampleLabelContext","ErrorBoundary","RequestExample","initialApiPlaygroundInputs","ResponseExample"],"mappings":";;;;;;;;;;AAwBO,MAAMA,IAAc,CAAC,EAAE,WAAAC,GAAW,SAAAC,IAAU,IAAO,kBAAAC,GAAkB,UAAAC,IAAW,SAA8B;AACnH,QAAM,EAAE,mBAAmBC,MAAiCC,EAAWC,CAAoB,GACrFC,IAAoBL,KAAoBE,GACxC,EAAE,wBAAAI,EAAA,IAA2BC,EAAA,GAC7B,EAAC,6BAAAC,EAAA,IAA+BC,EAAA,GAChCC,IAASJ,EAAA,GACT,CAACK,GAAeC,CAAgB,IAAIC,EAAA,GAEpCC,IAAqBC;AAAA,IACzB,MACEC;AAAA,MACE;AAAA,MACAlB;AAAA,IAAA;AAAA,IAEJ,CAACA,GAAWC,CAAO;AAAA,EAAA;AAGrB,SACE,gBAAAkB,EAACC,EAAwB,UAAxB,EAAiC,OAAO,EAAE,eAAAP,GAAe,kBAAAC,KACxD,UAAA,gBAAAK,EAAC,OAAA,EAAI,WAAWH,GACd,4BAACK,GAAA,EACC,UAAA;AAAA,IAAA,gBAAAF;AAAA,MAACG;AAAA,MAAA;AAAA,QACC,6BAAAZ;AAAA,QACA,kBAAkBH;AAAA,QAClB,QAAQJ,IAAWoB,IAA6BX;AAAA,QAChD,WAAU;AAAA,MAAA;AAAA,IAAA;AAAA,IAEZ,gBAAAO,EAACK,GAAA,EAAgB,kBAAkBjB,GAAmB,WAAU,oBAAA,CAAoB;AAAA,EAAA,EAAA,CAEtF,GACF,GACF;AAEJ;"}
|