@mintlify/msft-sdk 1.1.25 → 1.1.27
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/ApiPlaygroundContext.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Request/BodySection.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Request/ParameterSection.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Request/PlaygroundModal.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Request/SecuritySection.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Request/ServerSection.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Request/index.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Request/inputs/ArrayInput.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Request/inputs/FileInput.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Request/inputs/NullInput.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Request/inputs/NumberInput.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Request/inputs/ObjectInput.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Request/inputs/RecursiveInput.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Request/inputs/SelectInput.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Request/inputs/StringInput.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Request/inputs/TextInput.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Response/CopyFileToClipboardButton.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Response/DownloadFileButton.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Response/ResponseBody/CodeResponseContent.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Response/ResponseBody/index.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Response/ResponseError.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Response/ResponseHeaders.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Response/ResponsePlaceholder.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Response/ResponseTable.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Response/ResponseTopbar.js.map +1 -1
- package/dist/api-playground/ApiPlayground/Response/index.js.map +1 -1
- package/dist/api-playground/ApiPlayground/components/AdditionalPropertyButton.js.map +1 -1
- package/dist/api-playground/ApiPlayground/components/ArrayCount.js.map +1 -1
- package/dist/api-playground/ApiPlayground/components/EndpointsMenuLink.js.map +1 -1
- package/dist/api-playground/ApiPlayground/components/InputContainer.js.map +1 -1
- package/dist/api-playground/ApiPlayground/components/InputSectionContainer.js.map +1 -1
- package/dist/api-playground/ApiPlayground/components/ObjectExpandButton.js.map +1 -1
- package/dist/api-playground/ApiPlayground/components/PathHeader.js.map +1 -1
- package/dist/api-playground/ApiPlayground/components/PlaygroundModalWrapper.js.map +1 -1
- package/dist/api-playground/ApiPlayground/components/TrashButton.js.map +1 -1
- package/dist/api-playground/ApiPlayground/components/TypeDropdown.js.map +1 -1
- package/dist/api-playground/ApiPlayground/index.js.map +1 -1
- package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/NumberMetadata.js.map +1 -1
- package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/StringMetadata.js.map +1 -1
- package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/index.js.map +1 -1
- package/dist/api-playground/EndpointFields/ParamFields/RecursiveParamField.js.map +1 -1
- package/dist/api-playground/EndpointFields/components/Description.js.map +1 -1
- package/dist/api-playground/EndpointFields/components/OneOfDropdown.js.map +1 -1
- package/dist/api-playground/EndpointFields/components/OptionDropdown.js.map +1 -1
- package/dist/api-playground/EndpointFields/components/SectionHeading.js.map +1 -1
- package/dist/api-playground/EndpointFields/index.js.map +1 -1
- package/dist/api-playground-2/Api.js.map +1 -1
- package/dist/api-playground-2/ApiExamples.js.map +1 -1
- package/dist/api-playground-2/ApiFields.js.map +1 -1
- package/dist/api-playground-2/components/EndpointFields/EndpointSecurity.js.map +1 -1
- package/dist/api-playground-2/components/EndpointFields/fields/NumberMetadata.js.map +1 -1
- package/dist/api-playground-2/components/EndpointFields/fields/PrimitiveParamField.js.map +1 -1
- package/dist/api-playground-2/components/EndpointFields/fields/SimpleArrayParamField.js.map +1 -1
- package/dist/api-playground-2/components/EndpointFields/fields/SimpleObjectParamField.js.map +1 -1
- package/dist/api-playground-2/components/EndpointFields/fields/SimplePrimitiveParamField.js.map +1 -1
- package/dist/api-playground-2/components/EndpointFields/fields/StringMetadata.js.map +1 -1
- package/dist/api-playground-2/components/Example/RequestExample.js +17 -15
- package/dist/api-playground-2/components/Example/RequestExample.js.map +1 -1
- package/dist/api-playground-2/components/Example/ResponseExample.js.map +1 -1
- package/dist/api-playground-2/components/Request/InputSectionContainer.js.map +1 -1
- package/dist/api-playground-2/components/TypeDropdown.js.map +1 -1
- package/dist/api-playground-2/contexts/ApiPlaygroundContext.js.map +1 -1
- package/dist/api-playground-2/generators/generateInteractiveCodeSample.js +10 -10
- package/dist/api-playground-2/generators/generateInteractiveCodeSample.js.map +1 -1
- package/dist/api-playground-2/generators/generateSnippetMap.js +24 -24
- package/dist/api-playground-2/generators/generateSnippetMap.js.map +1 -1
- package/dist/api-playground-2/hooks/useSendPlaygroundRequest.js.map +1 -1
- package/dist/components/Api/ErrorBoundary.js.map +1 -1
- package/dist/components/Api/Expandable.js.map +1 -1
- package/dist/components/Api/Markdown.js.map +1 -1
- package/dist/components/Api/MethodPill.js.map +1 -1
- package/dist/components/Api/Param.js.map +1 -1
- package/dist/components/Api/colors.js.map +1 -1
- package/dist/components/content-components/CodeGroupSelect/CodeGroupCopyButton.js.map +1 -1
- package/dist/components/content-components/CodeGroupSelect/CodeSelectDropdown.js.map +1 -1
- package/dist/components/content-components/CodeGroupSelect/index.js.map +1 -1
- package/dist/components/content-components/code-block.js.map +1 -1
- package/dist/components/content-components/code-group.js.map +1 -1
- package/dist/components/content-components/code-snippet.js.map +1 -1
- package/dist/components/content-components/code-snippets.js.map +1 -1
- package/dist/components/content-components/getNodeText.js.map +1 -1
- package/dist/components/docsLayout.js +29 -27
- package/dist/components/docsLayout.js.map +1 -1
- package/dist/components/nav-tree/index.js +174 -178
- package/dist/components/nav-tree/index.js.map +1 -1
- package/dist/contexts/CodeExampleLabelContext.js.map +1 -1
- package/dist/contexts/ConfigContext.js.map +1 -1
- package/dist/contexts/EndpointLocationContext.js.map +1 -1
- package/dist/contexts/MDXContentContext.js.map +1 -1
- package/dist/hooks/useApiPlaygroundDisplay.js.map +1 -1
- package/dist/hooks/useApiPlaygroundInputs.js.map +1 -1
- package/dist/hooks/useBaseUrlOptions.js.map +1 -1
- package/dist/hooks/useEndpoint.js.map +1 -1
- package/dist/hooks/useKeyboardShortcut.js.map +1 -1
- package/dist/hooks/useMDXContent.js.map +1 -1
- package/dist/hooks/useMDXContentController/useApiPlaygroundInputs.js.map +1 -1
- package/dist/hooks/useMDXContentController/useMDXContentCallbacks/useSetApiBaseIndexCallback.js.map +1 -1
- package/dist/hooks/useMDXContentController/useMDXContentCallbacks/useSetApiPlaygroundInputsCallback.js.map +1 -1
- package/dist/hooks/usePlaygroundSchemaOptions.js.map +1 -1
- package/dist/hooks/usePrefilledInputs/index.js.map +1 -1
- package/dist/hooks/usePrefilledInputs/storedServerVariables.js.map +1 -1
- package/dist/hooks/useSecurityOption.js.map +1 -1
- package/dist/hooks/useSendPlaygroundRequest.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiPlaygroundContext.js","sources":["../../../src/api-playground/ApiPlayground/ApiPlaygroundContext.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"ApiPlaygroundContext.js","sources":["../../../src/api-playground/ApiPlayground/ApiPlaygroundContext.tsx"],"sourcesContent":["\nimport { ApiPlaygroundResultType } from '@mintlify/models';\nimport { createContext } from 'react';\n\nexport type ApiPlaygroundContextType = {\n isSending?: boolean;\n sendRequest?: () => void;\n isPlaygroundExpanded: boolean;\n result?: ApiPlaygroundResultType;\n selectedBaseUrlIndex: number;\n setSelectedBaseUrlIndex?: (index: number) => void;\n setIsPlaygroundExpanded?: (expanded: boolean) => void;\n baseUrlOptions?: string[];\n selectedExampleIndex?: number;\n setSelectedExampleIndex?: (index: number) => void;\n};\n\nexport const ApiPlaygroundContext = createContext<ApiPlaygroundContextType>({\n isSending: false,\n selectedBaseUrlIndex: 0,\n isPlaygroundExpanded: false,\n selectedExampleIndex: 0,\n});\n"],"names":["ApiPlaygroundContext","createContext"],"mappings":";AAiBO,MAAMA,IAAuBC,EAAwC;AAAA,EAC1E,WAAW;AAAA,EACX,sBAAsB;AAAA,EACtB,sBAAsB;AAAA,EACtB,sBAAsB;AACxB,CAAC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BodySection.js","sources":["../../../../src/api-playground/ApiPlayground/Request/BodySection.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"BodySection.js","sources":["../../../../src/api-playground/ApiPlayground/Request/BodySection.tsx"],"sourcesContent":["\nimport { BodySchema, DataSchemaArray, IncrementalDataSchemaArray } from '@mintlify/validation';\nimport { SetStateAction, useMemo, useState } from 'react';\n\nimport { Tab, Tabs } from '@/components/content-components/tabs';\nimport { NoAnyDataSchema } from '@/hooks/usePlaygroundSchemaOptions';\n\nimport { InputSectionContainer } from '../components/InputSectionContainer';\nimport { TypeDropdown } from '../components/TypeDropdown';\nimport { RecursiveInput } from './inputs/RecursiveInput';\n\ntype BodySectionParams = {\n body: BodySchema;\n value: unknown;\n setValue: (value: unknown) => void;\n};\n\nexport const BodySection = ({ body, value, setValue }: BodySectionParams) => {\n const [selectedSchemaArrayIndex, setSelectedSchemaArrayIndex] = useState(0);\n const [selectedContentTypeIndex, setSelectedContentTypeIndex] = useState(0);\n\n const bodyArray = useMemo(() => {\n return Object.entries(body);\n }, [body]);\n\n const contentTypeAndContent = bodyArray[selectedContentTypeIndex] ?? bodyArray[0];\n if (contentTypeAndContent === undefined) return null;\n\n const [_contentType, { schemaArray }] = contentTypeAndContent;\n\n return (\n <InputSectionContainer\n name=\"Body\"\n rightElement={\n bodyArray.length > 1 && (\n <div onClick={(e) => e.stopPropagation()} className=\"mint:text-xs mint:font-mono\">\n <TypeDropdown\n options={bodyArray.map(([label, schema]) => ({\n label,\n schema: schema as unknown as NoAnyDataSchema,\n }))}\n selectedIndex={selectedContentTypeIndex}\n onSelectOption={(index) => {\n setSelectedContentTypeIndex(index);\n }}\n />\n </div>\n )\n }\n >\n {schemaArray.length > 1 ? (\n <Tabs\n defaultTab={selectedSchemaArrayIndex}\n onClickTab={(index: SetStateAction<number>) => setSelectedSchemaArrayIndex(index)}\n className=\"mint:mb-0!\"\n >\n {schemaArray.map((schema, index) => {\n const title = schema.title ?? `Option ${index + 1}`;\n return (\n <Tab key={title} title={title}>\n <RecursiveInput\n schemaArray={[schema] as DataSchemaArray | IncrementalDataSchemaArray}\n value={value}\n setValue={setValue}\n clearValue={value === undefined ? undefined : () => setValue(undefined)}\n isBody\n />\n </Tab>\n );\n })}\n </Tabs>\n ) : (\n <RecursiveInput\n schemaArray={schemaArray}\n value={value}\n setValue={setValue}\n clearValue={value === undefined ? undefined : () => setValue(undefined)}\n isBody\n />\n )}\n </InputSectionContainer>\n );\n};\n"],"names":["BodySection","body","value","setValue","selectedSchemaArrayIndex","setSelectedSchemaArrayIndex","useState","selectedContentTypeIndex","setSelectedContentTypeIndex","bodyArray","useMemo","contentTypeAndContent","_contentType","schemaArray","jsx","InputSectionContainer","TypeDropdown","label","schema","index","Tabs","title","Tab","RecursiveInput"],"mappings":";;;;;;;AAiBO,MAAMA,IAAc,CAAC,EAAE,MAAAC,GAAM,OAAAC,GAAO,UAAAC,QAAkC;AAC3E,QAAM,CAACC,GAA0BC,CAA2B,IAAIC,EAAS,CAAC,GACpE,CAACC,GAA0BC,CAA2B,IAAIF,EAAS,CAAC,GAEpEG,IAAYC,EAAQ,MACjB,OAAO,QAAQT,CAAI,GACzB,C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AAAA,UACA,OAAAX;AAAA,UACA,UAAAC;AAAA,UACA,YAAYD,MAAU,SAAY,SAAY,MAAMC,EAAS,MAAS;AAAA,UACtE,QAAM;AAAA,QAAA;AAAA,MAAA;AAAA,IACR;AAAA,EAAA;AAIR;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ParameterSection.js","sources":["../../../../src/api-playground/ApiPlayground/Request/ParameterSection.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"ParameterSection.js","sources":["../../../../src/api-playground/ApiPlayground/Request/ParameterSection.tsx"],"sourcesContent":["\nimport { ParameterGroup } from '@mintlify/validation';\nimport { useMemo } from 'react';\n\nimport { InputSectionContainer } from '../components/InputSectionContainer';\nimport { RecursiveInput } from './inputs/RecursiveInput';\n\ntype ParameterSectionParams = {\n name: string;\n parameters: ParameterGroup;\n value: Record<string, unknown>;\n setValue: (value: Record<string, unknown>) => void;\n};\n\nexport const ParameterSection = ({ name, parameters, value, setValue }: ParameterSectionParams) => {\n const inputs = useMemo(() => {\n return Object.entries(parameters).map(([paramName, parameter]) => {\n const paramValue = value[paramName];\n const setParamValue = (newParamValue: unknown) => {\n const newObj = { ...value };\n newObj[paramName] = newParamValue;\n setValue(newObj);\n };\n\n const clearParamValue =\n paramValue === undefined\n ? undefined\n : () => {\n const newObj = { ...value };\n delete newObj[paramName];\n setValue(newObj);\n };\n\n return (\n <RecursiveInput\n key={paramName}\n name={paramName}\n schemaArray={parameter.schema}\n style={parameter.style}\n explode={parameter.explode}\n value={paramValue}\n setValue={setParamValue}\n clearValue={clearParamValue}\n />\n );\n });\n }, [parameters, setValue, value]);\n\n if (inputs.length === 0) {\n return null;\n }\n\n return <InputSectionContainer name={name}>{inputs}</InputSectionContainer>;\n};\n"],"names":["ParameterSection","name","parameters","value","setValue","inputs","useMemo","paramName","parameter","paramValue","setParamValue","newParamValue","newObj","clearParamValue","jsx","RecursiveInput","InputSectionContainer"],"mappings":";;;;AAcO,MAAMA,IAAmB,CAAC,EAAE,MAAAC,GAAM,YAAAC,GAAY,OAAAC,GAAO,UAAAC,QAAuC;AACjG,QAAMC,IAASC,EAAQ,MACd,OAAO,QAAQJ,CAAU,EAAE,IAAI,CAAC,CAACK,GAAWC,CAAS,MAAM;AAChE,UAAMC,IAAaN,EAAMI,CAAS,GAC5BG,IAAgB,CAACC,MAA2B;AAChD,YAAMC,IAAS,EAAE,GAAGT,EAAA;AACpB,MAAAS,EAAOL,CAAS,IAAII,GACpBP,EAASQ,CAAM;AAAA,IACjB,GAEMC,IACJJ,MAAe,SACX,SACA,MAAM;AACJ,YAAMG,IAAS,EAAE,GAAGT,EAAA;AACpB,aAAOS,EAAOL,CAAS,GACvBH,EAASQ,CAAM;AAAA,IACjB;AAEN,WACE,gBAAAE;AAAA,MAACC;AAAA,MAAA;AAAA,QAEC,MAAMR;AAAA,QACN,aAAaC,EAAU;AAAA,QACvB,OAAOA,EAAU;AAAA,QACjB,SAASA,EAAU;AAAA,QACnB,OAAOC;AAAA,QACP,UAAUC;AAAA,QACV,YAAYG;AAAA,MAAA;AAAA,MAPPN;AAAA,IAAA;AAAA,EAUX,CAAC,GACA,CAACL,GAAYE,GAAUD,CAAK,CAAC;AAEhC,SAAIE,EAAO,WAAW,IACb,OAGF,gBAAAS,EAACE,GAAA,EAAsB,MAAAf,GAAa,UAAAI,EAAA,CAAO;AACpD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlaygroundModal.js","sources":["../../../../src/api-playground/ApiPlayground/Request/PlaygroundModal.tsx"],"sourcesContent":["'use client';\n\nimport { ApiPlaygroundInputs, Endpoint } from '@mintlify/validation';\nimport { useContext, useState, useEffect } from 'react';\n\nimport { DescriptionWithoutHeaders } from '@/api-playground/EndpointFields/components/Description';\nimport { useApiPlaygroundPrefillExamples } from '@/hooks/useApiPlaygroundPrefillExamples';\nimport { useMDXContent } from '@/hooks/useMDXContent';\nimport { parseAuthInputsFromUserInfo } from '@/hooks/usePrefilledInputs';\nimport { useSecurityOption } from '@/hooks/useSecurityOption';\nimport {\n getDefaultsFromParameterGroup,\n getDefaultFromSchema,\n} from '@/utils/api-playground/defaults';\nimport { paramFieldDefaults } from '@/utils/api-playground/paramFieldDefaults';\nimport { getFilteredSecurityOptions } from '@/utils/api-reference/getFilteredSecurityOptions';\nimport { cn } from '@/api-playground-2/schemaGraph/utils';\n\nimport { ApiPlaygroundContext } from '../ApiPlaygroundContext';\nimport { Response } from '../Response';\nimport { EndpointsMenu } from '../components/EndpointsMenu';\nimport { PathHeader, SendPill } from '../components/PathHeader';\nimport { PlaygroundModalWrapper } from '../components/PlaygroundModalWrapper';\nimport { BodySection } from './BodySection';\nimport { ParameterSection } from './ParameterSection';\nimport { SecuritySection } from './SecuritySection';\nimport { ServerSection } from './ServerSection';\nimport ApiExamples from '@/api-playground-2/ApiExamples';\n\nexport function PlaygroundModal({\n endpoint,\n inputs,\n setInputs,\n pathname,\n}: {\n endpoint: Endpoint;\n inputs: ApiPlaygroundInputs;\n setInputs: (inputs: ApiPlaygroundInputs) => void;\n pathname: string;\n}) {\n const [{ pageMetadata }] = useMDXContent();\n const [selectedSecurityOptionIndex, setSelectedSecurityOptionIndex] = useState(0);\n const { prefillExamplesEnabled, generatedRequestExampleData } = useApiPlaygroundPrefillExamples();\n const securityOption = useSecurityOption(endpoint.request.security);\n\n const {\n isSending,\n selectedBaseUrlIndex,\n isPlaygroundExpanded,\n setIsPlaygroundExpanded,\n sendRequest,\n result,\n selectedExampleIndex,\n } = useContext(ApiPlaygroundContext);\n const server = endpoint.servers?.[selectedBaseUrlIndex];\n\n const filteredSecurityOptions = getFilteredSecurityOptions(endpoint);\n\n const selectedSecurityOption = filteredSecurityOptions[selectedSecurityOptionIndex];\n\n const variables = server?.variables;\n\n useEffect(() => {\n if (!isPlaygroundExpanded) return;\n\n const nextInputs: ApiPlaygroundInputs = prefillExamplesEnabled\n ? generatedRequestExampleData[selectedExampleIndex ?? 0]\n : JSON.parse(JSON.stringify(inputs));\n\n if (variables) {\n const serverDefaults: Record<string, string> = {};\n Object.entries(variables).forEach(([k, v]) => {\n if (nextInputs.server[k] === undefined) {\n serverDefaults[k] = String(v.default);\n }\n });\n nextInputs.server = { ...nextInputs.server, ...serverDefaults };\n }\n\n const paramSections: Array<\n ['header' | 'path' | 'query' | 'cookie', typeof endpoint.request.parameters.header]\n > = [\n ['header', endpoint.request.parameters.header],\n ['path', endpoint.request.parameters.path],\n ['query', endpoint.request.parameters.query],\n ['cookie', endpoint.request.parameters.cookie],\n ];\n\n paramSections.forEach(([section, group]) => {\n const spec = prefillExamplesEnabled\n ? generatedRequestExampleData[selectedExampleIndex ?? 0]?.[section]\n : getDefaultsFromParameterGroup(group);\n\n nextInputs[section] = {\n ...spec,\n ...paramFieldDefaults[section],\n ...nextInputs[section],\n };\n });\n\n const userInfoAuthInputs = parseAuthInputsFromUserInfo(\n securityOption,\n undefined\n );\n\n nextInputs.query = { ...nextInputs.query, ...userInfoAuthInputs.query };\n nextInputs.header = { ...nextInputs.header, ...userInfoAuthInputs.header };\n nextInputs.cookie = { ...nextInputs.cookie, ...userInfoAuthInputs.cookie };\n\n const bodyEntry = Object.values(endpoint.request.body)[0];\n if (bodyEntry?.schemaArray.length) {\n const bodyDefaultFromSpec = prefillExamplesEnabled\n ? generatedRequestExampleData[selectedExampleIndex ?? 0]?.body\n : getDefaultFromSchema(bodyEntry.schemaArray[0]);\n\n const bodyDefaultsFromParamField: Record<string, unknown> = paramFieldDefaults.body;\n\n if (typeof bodyDefaultFromSpec === 'object' && bodyDefaultFromSpec !== null) {\n nextInputs.body = Object.assign(\n {},\n bodyDefaultFromSpec,\n bodyDefaultsFromParamField,\n typeof nextInputs.body === 'object' &&\n nextInputs.body !== null &&\n !Array.isArray(nextInputs.body)\n ? nextInputs.body\n : {}\n );\n } else if (Object.keys(bodyDefaultsFromParamField).length) {\n const existingBody =\n typeof nextInputs.body === 'object' &&\n nextInputs.body !== null &&\n !Array.isArray(nextInputs.body)\n ? nextInputs.body\n : {};\n nextInputs.body = { ...bodyDefaultsFromParamField, ...existingBody };\n } else if (nextInputs.body === undefined && bodyDefaultFromSpec !== undefined) {\n nextInputs.body = bodyDefaultFromSpec;\n }\n }\n\n if (JSON.stringify(nextInputs) !== JSON.stringify(inputs)) {\n setInputs(nextInputs);\n }\n }, [isPlaygroundExpanded, endpoint, selectedExampleIndex, securityOption]);\n\n return (\n <PlaygroundModalWrapper\n isPlaygroundExpanded={isPlaygroundExpanded}\n setIsPlaygroundExpanded={setIsPlaygroundExpanded}\n >\n <div className=\"mint:flex mint:items-center mint:justify-between mint:gap-x-2\">\n <EndpointsMenu endpoint={endpoint} pathname={pathname} />\n <PathHeader endpoint={endpoint} hasGrayBackground display=\"interactive\" />\n <SendPill\n label=\"Send\"\n method={endpoint.method}\n isSending={isSending}\n onClick={sendRequest}\n className=\"mint:w-20\"\n />\n </div>\n <div className=\"mint:grid mint:grid-cols-1 mint:lg:grid-cols-5 mint:gap-x-8 mint:gap-y-6 mint:mt-5 mint:relative\">\n <div className=\"mint:col-span-1 mint:lg:col-span-3\">\n <div className=\"mint:space-y-1 mint:min-w-full mint:w-full mint:max-w-full mint:overflow-hidden\">\n <div className=\"mint:text-base mint:font-medium mint:text-gray-900 mint:dark:text-white mint:max-w-full\">\n {endpoint.title}\n </div>\n <div className=\"mint:flex mint:items-start mint:gap-x-12 mint:justify-between mint:max-w-full! mint:overflow-x-auto\">\n {pageMetadata.description && (\n <DescriptionWithoutHeaders\n markdown={pageMetadata.description}\n className=\"mint:text-sm mint:text-gray-500 mint:dark:text-gray-400\"\n />\n )}\n </div>\n </div>\n {result && <Response result={result} className=\"mint:mt-6 mint:block mint:lg:hidden\" />}\n <div className=\"mint:space-y-2 mint:mt-6\">\n {variables && Object.keys(variables).length > 0 && (\n <ServerSection\n variables={variables}\n value={inputs.server}\n setValue={(server) => setInputs({ ...inputs, server })}\n />\n )}\n {selectedSecurityOption && (\n <SecuritySection\n inputs={inputs}\n setInputs={setInputs}\n securityOptions={filteredSecurityOptions}\n selectedSecurityOptionIndex={selectedSecurityOptionIndex}\n setSelectedSecurityOptionIndex={setSelectedSecurityOptionIndex}\n />\n )}\n <ParameterSection\n name=\"Header\"\n value={inputs.header}\n setValue={(header) => setInputs({ ...inputs, header })}\n parameters={endpoint.request.parameters.header}\n />\n <ParameterSection\n name=\"Cookie\"\n value={inputs.cookie}\n setValue={(cookie) => setInputs({ ...inputs, cookie })}\n parameters={endpoint.request.parameters.cookie}\n />\n <ParameterSection\n name=\"Path\"\n value={inputs.path}\n setValue={(path) => setInputs({ ...inputs, path })}\n parameters={endpoint.request.parameters.path}\n />\n <ParameterSection\n name=\"Query\"\n value={inputs.query}\n setValue={(query) => setInputs({ ...inputs, query })}\n parameters={endpoint.request.parameters.query}\n />\n <BodySection\n value={inputs.body}\n setValue={(body) => setInputs({ ...inputs, body })}\n body={endpoint.request.body}\n />\n </div>\n </div>\n <div\n className={cn(\n 'mint:p-px mint:col-span-1 mint:lg:col-span-2 mint:lg:space-y-6 mint:lg:flex mint:lg:sticky mint:lg:top-0 mint:lg:self-start mint:lg:h-[calc(100vh-5.5rem)]',\n result && 'mint:lg:flex-col mint:overflow-y-auto mint:lg:-top-12 mint:lg:h-screen'\n )}\n >\n {result && <Response result={result} className=\"mint:hidden mint:lg:block mint:min-h-fit\" />}\n <ApiExamples isModal data-testid=\"api-playground-request-example\" className=\"mint:xl:w-full\" />\n </div>\n </div>\n </PlaygroundModalWrapper>\n );\n}\n"],"names":["PlaygroundModal","endpoint","inputs","setInputs","pathname","pageMetadata","useMDXContent","selectedSecurityOptionIndex","setSelectedSecurityOptionIndex","useState","prefillExamplesEnabled","generatedRequestExampleData","useApiPlaygroundPrefillExamples","securityOption","useSecurityOption","isSending","selectedBaseUrlIndex","isPlaygroundExpanded","setIsPlaygroundExpanded","sendRequest","result","selectedExampleIndex","useContext","ApiPlaygroundContext","server","_a","filteredSecurityOptions","getFilteredSecurityOptions","selectedSecurityOption","variables","useEffect","nextInputs","serverDefaults","k","v","section","group","spec","getDefaultsFromParameterGroup","paramFieldDefaults","userInfoAuthInputs","parseAuthInputsFromUserInfo","bodyEntry","bodyDefaultFromSpec","getDefaultFromSchema","bodyDefaultsFromParamField","existingBody","jsxs","PlaygroundModalWrapper","jsx","EndpointsMenu","PathHeader","SendPill","DescriptionWithoutHeaders","Response","ServerSection","SecuritySection","ParameterSection","header","cookie","path","query","BodySection","body","cn","ApiExamples"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA6BO,SAASA,GAAgB;AAAA,EAC9B,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AACF,GAKG;;AACD,QAAM,CAAC,EAAE,cAAAC,GAAc,IAAIC,EAAA,GACrB,CAACC,GAA6BC,CAA8B,IAAIC,EAAS,CAAC,GAC1E,EAAE,wBAAAC,GAAwB,6BAAAC,EAAA,IAAgCC,EAAA,GAC1DC,IAAiBC,EAAkBb,EAAS,QAAQ,QAAQ,GAE5D;AAAA,IACJ,WAAAc;AAAA,IACA,sBAAAC;AAAA,IACA,sBAAAC;AAAA,IACA,yBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,QAAAC;AAAA,IACA,sBAAAC;AAAA,EAAA,IACEC,EAAWC,CAAoB,GAC7BC,KAASC,IAAAxB,EAAS,YAAT,gBAAAwB,EAAmBT,IAE5BU,IAA0BC,EAA2B1B,CAAQ,GAE7D2B,IAAyBF,EAAwBnB,CAA2B,GAE5EsB,IAAYL,KAAA,gBAAAA,EAAQ;AAE1B,SAAAM,EAAU,MAAM;;AACd,QAAI,CAACb,EAAsB;AAE3B,UAAMc,IAAkCrB,IACpCC,EAA4BU,KAAwB,CAAC,IACrD,KAAK,MAAM,KAAK,UAAUnB,CAAM,CAAC;AAErC,QAAI2B,GAAW;AACb,YAAMG,IAAyC,CAAA;AAC/C,aAAO,QAAQH,CAAS,EAAE,QAAQ,CAAC,CAACI,GAAGC,CAAC,MAAM;AAC5C,QAAIH,EAAW,O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A;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
1
|
+
{"version":3,"file":"PlaygroundModal.js","sources":["../../../../src/api-playground/ApiPlayground/Request/PlaygroundModal.tsx"],"sourcesContent":["\nimport { ApiPlaygroundInputs, Endpoint } from '@mintlify/validation';\nimport { useContext, useState, useEffect } from 'react';\n\nimport { DescriptionWithoutHeaders } from '@/api-playground/EndpointFields/components/Description';\nimport { useApiPlaygroundPrefillExamples } from '@/hooks/useApiPlaygroundPrefillExamples';\nimport { useMDXContent } from '@/hooks/useMDXContent';\nimport { parseAuthInputsFromUserInfo } from '@/hooks/usePrefilledInputs';\nimport { useSecurityOption } from '@/hooks/useSecurityOption';\nimport {\n getDefaultsFromParameterGroup,\n getDefaultFromSchema,\n} from '@/utils/api-playground/defaults';\nimport { paramFieldDefaults } from '@/utils/api-playground/paramFieldDefaults';\nimport { getFilteredSecurityOptions } from '@/utils/api-reference/getFilteredSecurityOptions';\nimport { cn } from '@/api-playground-2/schemaGraph/utils';\n\nimport { ApiPlaygroundContext } from '../ApiPlaygroundContext';\nimport { Response } from '../Response';\nimport { EndpointsMenu } from '../components/EndpointsMenu';\nimport { PathHeader, SendPill } from '../components/PathHeader';\nimport { PlaygroundModalWrapper } from '../components/PlaygroundModalWrapper';\nimport { BodySection } from './BodySection';\nimport { ParameterSection } from './ParameterSection';\nimport { SecuritySection } from './SecuritySection';\nimport { ServerSection } from './ServerSection';\nimport ApiExamples from '@/api-playground-2/ApiExamples';\n\nexport function PlaygroundModal({\n endpoint,\n inputs,\n setInputs,\n pathname,\n}: {\n endpoint: Endpoint;\n inputs: ApiPlaygroundInputs;\n setInputs: (inputs: ApiPlaygroundInputs) => void;\n pathname: string;\n}) {\n const [{ pageMetadata }] = useMDXContent();\n const [selectedSecurityOptionIndex, setSelectedSecurityOptionIndex] = useState(0);\n const { prefillExamplesEnabled, generatedRequestExampleData } = useApiPlaygroundPrefillExamples();\n const securityOption = useSecurityOption(endpoint.request.security);\n\n const {\n isSending,\n selectedBaseUrlIndex,\n isPlaygroundExpanded,\n setIsPlaygroundExpanded,\n sendRequest,\n result,\n selectedExampleIndex,\n } = useContext(ApiPlaygroundContext);\n const server = endpoint.servers?.[selectedBaseUrlIndex];\n\n const filteredSecurityOptions = getFilteredSecurityOptions(endpoint);\n\n const selectedSecurityOption = filteredSecurityOptions[selectedSecurityOptionIndex];\n\n const variables = server?.variables;\n\n useEffect(() => {\n if (!isPlaygroundExpanded) return;\n\n const nextInputs: ApiPlaygroundInputs = prefillExamplesEnabled\n ? generatedRequestExampleData[selectedExampleIndex ?? 0]\n : JSON.parse(JSON.stringify(inputs));\n\n if (variables) {\n const serverDefaults: Record<string, string> = {};\n Object.entries(variables).forEach(([k, v]) => {\n if (nextInputs.server[k] === undefined) {\n serverDefaults[k] = String(v.default);\n }\n });\n nextInputs.server = { ...nextInputs.server, ...serverDefaults };\n }\n\n const paramSections: Array<\n ['header' | 'path' | 'query' | 'cookie', typeof endpoint.request.parameters.header]\n > = [\n ['header', endpoint.request.parameters.header],\n ['path', endpoint.request.parameters.path],\n ['query', endpoint.request.parameters.query],\n ['cookie', endpoint.request.parameters.cookie],\n ];\n\n paramSections.forEach(([section, group]) => {\n const spec = prefillExamplesEnabled\n ? generatedRequestExampleData[selectedExampleIndex ?? 0]?.[section]\n : getDefaultsFromParameterGroup(group);\n\n nextInputs[section] = {\n ...spec,\n ...paramFieldDefaults[section],\n ...nextInputs[section],\n };\n });\n\n const userInfoAuthInputs = parseAuthInputsFromUserInfo(\n securityOption,\n undefined\n );\n\n nextInputs.query = { ...nextInputs.query, ...userInfoAuthInputs.query };\n nextInputs.header = { ...nextInputs.header, ...userInfoAuthInputs.header };\n nextInputs.cookie = { ...nextInputs.cookie, ...userInfoAuthInputs.cookie };\n\n const bodyEntry = Object.values(endpoint.request.body)[0];\n if (bodyEntry?.schemaArray.length) {\n const bodyDefaultFromSpec = prefillExamplesEnabled\n ? generatedRequestExampleData[selectedExampleIndex ?? 0]?.body\n : getDefaultFromSchema(bodyEntry.schemaArray[0]);\n\n const bodyDefaultsFromParamField: Record<string, unknown> = paramFieldDefaults.body;\n\n if (typeof bodyDefaultFromSpec === 'object' && bodyDefaultFromSpec !== null) {\n nextInputs.body = Object.assign(\n {},\n bodyDefaultFromSpec,\n bodyDefaultsFromParamField,\n typeof nextInputs.body === 'object' &&\n nextInputs.body !== null &&\n !Array.isArray(nextInputs.body)\n ? nextInputs.body\n : {}\n );\n } else if (Object.keys(bodyDefaultsFromParamField).length) {\n const existingBody =\n typeof nextInputs.body === 'object' &&\n nextInputs.body !== null &&\n !Array.isArray(nextInputs.body)\n ? nextInputs.body\n : {};\n nextInputs.body = { ...bodyDefaultsFromParamField, ...existingBody };\n } else if (nextInputs.body === undefined && bodyDefaultFromSpec !== undefined) {\n nextInputs.body = bodyDefaultFromSpec;\n }\n }\n\n if (JSON.stringify(nextInputs) !== JSON.stringify(inputs)) {\n setInputs(nextInputs);\n }\n }, [isPlaygroundExpanded, endpoint, selectedExampleIndex, securityOption]);\n\n return (\n <PlaygroundModalWrapper\n isPlaygroundExpanded={isPlaygroundExpanded}\n setIsPlaygroundExpanded={setIsPlaygroundExpanded}\n >\n <div className=\"mint:flex mint:items-center mint:justify-between mint:gap-x-2\">\n <EndpointsMenu endpoint={endpoint} pathname={pathname} />\n <PathHeader endpoint={endpoint} hasGrayBackground display=\"interactive\" />\n <SendPill\n label=\"Send\"\n method={endpoint.method}\n isSending={isSending}\n onClick={sendRequest}\n className=\"mint:w-20\"\n />\n </div>\n <div className=\"mint:grid mint:grid-cols-1 mint:lg:grid-cols-5 mint:gap-x-8 mint:gap-y-6 mint:mt-5 mint:relative\">\n <div className=\"mint:col-span-1 mint:lg:col-span-3\">\n <div className=\"mint:space-y-1 mint:min-w-full mint:w-full mint:max-w-full mint:overflow-hidden\">\n <div className=\"mint:text-base mint:font-medium mint:text-gray-900 mint:dark:text-white mint:max-w-full\">\n {endpoint.title}\n </div>\n <div className=\"mint:flex mint:items-start mint:gap-x-12 mint:justify-between mint:max-w-full! mint:overflow-x-auto\">\n {pageMetadata.description && (\n <DescriptionWithoutHeaders\n markdown={pageMetadata.description}\n className=\"mint:text-sm mint:text-gray-500 mint:dark:text-gray-400\"\n />\n )}\n </div>\n </div>\n {result && <Response result={result} className=\"mint:mt-6 mint:block mint:lg:hidden\" />}\n <div className=\"mint:space-y-2 mint:mt-6\">\n {variables && Object.keys(variables).length > 0 && (\n <ServerSection\n variables={variables}\n value={inputs.server}\n setValue={(server) => setInputs({ ...inputs, server })}\n />\n )}\n {selectedSecurityOption && (\n <SecuritySection\n inputs={inputs}\n setInputs={setInputs}\n securityOptions={filteredSecurityOptions}\n selectedSecurityOptionIndex={selectedSecurityOptionIndex}\n setSelectedSecurityOptionIndex={setSelectedSecurityOptionIndex}\n />\n )}\n <ParameterSection\n name=\"Header\"\n value={inputs.header}\n setValue={(header) => setInputs({ ...inputs, header })}\n parameters={endpoint.request.parameters.header}\n />\n <ParameterSection\n name=\"Cookie\"\n value={inputs.cookie}\n setValue={(cookie) => setInputs({ ...inputs, cookie })}\n parameters={endpoint.request.parameters.cookie}\n />\n <ParameterSection\n name=\"Path\"\n value={inputs.path}\n setValue={(path) => setInputs({ ...inputs, path })}\n parameters={endpoint.request.parameters.path}\n />\n <ParameterSection\n name=\"Query\"\n value={inputs.query}\n setValue={(query) => setInputs({ ...inputs, query })}\n parameters={endpoint.request.parameters.query}\n />\n <BodySection\n value={inputs.body}\n setValue={(body) => setInputs({ ...inputs, body })}\n body={endpoint.request.body}\n />\n </div>\n </div>\n <div\n className={cn(\n 'mint:p-px mint:col-span-1 mint:lg:col-span-2 mint:lg:space-y-6 mint:lg:flex mint:lg:sticky mint:lg:top-0 mint:lg:self-start mint:lg:h-[calc(100vh-5.5rem)]',\n result && 'mint:lg:flex-col mint:overflow-y-auto mint:lg:-top-12 mint:lg:h-screen'\n )}\n >\n {result && <Response result={result} className=\"mint:hidden mint:lg:block mint:min-h-fit\" />}\n <ApiExamples isModal data-testid=\"api-playground-request-example\" className=\"mint:xl:w-full\" />\n </div>\n </div>\n </PlaygroundModalWrapper>\n );\n}\n"],"names":["PlaygroundModal","endpoint","inputs","setInputs","pathname","pageMetadata","useMDXContent","selectedSecurityOptionIndex","setSelectedSecurityOptionIndex","useState","prefillExamplesEnabled","generatedRequestExampleData","useApiPlaygroundPrefillExamples","securityOption","useSecurityOption","isSending","selectedBaseUrlIndex","isPlaygroundExpanded","setIsPlaygroundExpanded","sendRequest","result","selectedExampleIndex","useContext","ApiPlaygroundContext","server","_a","filteredSecurityOptions","getFilteredSecurityOptions","selectedSecurityOption","variables","useEffect","nextInputs","serverDefaults","k","v","section","group","spec","getDefaultsFromParameterGroup","paramFieldDefaults","userInfoAuthInputs","parseAuthInputsFromUserInfo","bodyEntry","bodyDefaultFromSpec","getDefaultFromSchema","bodyDefaultsFromParamField","existingBody","jsxs","PlaygroundModalWrapper","jsx","EndpointsMenu","PathHeader","SendPill","DescriptionWithoutHeaders","Response","ServerSection","SecuritySection","ParameterSection","header","cookie","path","query","BodySection","body","cn","ApiExamples"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA4BO,SAASA,GAAgB;AAAA,EAC9B,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AACF,GAKG;;AACD,QAAM,CAAC,EAAE,cAAAC,GAAc,IAAIC,EAAA,GACrB,CAACC,GAA6BC,CAA8B,IAAIC,EAAS,CAAC,GAC1E,EAAE,wBAAAC,GAAwB,6BAAAC,EAAA,IAAgCC,EAAA,GAC1DC,IAAiBC,EAAkBb,EAAS,QAAQ,QAAQ,GAE5D;AAAA,IACJ,WAAAc;AAAA,IACA,sBAAAC;AAAA,IACA,sBAAAC;AAAA,IACA,yBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,QAAAC;AAAA,IACA,sBAAAC;AAAA,EAAA,IACEC,EAAWC,CAAoB,GAC7BC,KAASC,IAAAxB,EAAS,YAAT,gBAAAwB,EAAmBT,IAE5BU,I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A,YACzB,EAAA,CACF;AAAA,UAAA,GACF;AAAA,UACA,gBAAA8C;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAWiB;AAAA,gBACT;AAAA,gBACA5C,KAAU;AAAA,cAAA;AAAA,cAGX,UAAA;AAAA,gBAAAA,KAAU,gBAAA6B,EAACK,GAAA,EAAS,QAAAlC,GAAgB,WAAU,4CAA2C;AAAA,kCACzF6C,IAAA,EAAY,SAAO,IAAC,eAAY,kCAAiC,WAAU,iBAAA,CAAiB;AAAA,cAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QAC/F,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SecuritySection.js","sources":["../../../../src/api-playground/ApiPlayground/Request/SecuritySection.tsx"],"sourcesContent":["'use client';\n\nimport {\n ApiPlaygroundInputs,\n DataSchemaArray,\n SecurityOption,\n SecurityParameterSchema,\n} from '@mintlify/validation';\nimport { useMemo } from 'react';\n\nimport { NoAnyDataSchema } from '@/hooks/usePlaygroundSchemaOptions';\nimport { cn } from '@/api-playground-2/schemaGraph/utils';\n\nimport { InputSectionContainer } from '../components/InputSectionContainer';\nimport { TypeDropdown } from '../components/TypeDropdown';\nimport { RecursiveInput } from './inputs/RecursiveInput';\n\nexport const basicDescription =\n 'Basic authentication header of the form `Basic <encoded-value>`, where `<encoded-value>` is the base64-encoded string `username:password`.';\nexport const bearerDescription =\n 'Bearer authentication header of the form `Bearer <token>`, where `<token>` is your auth token.';\nexport const oauth2Description =\n 'The access token received from the authorization server in the OAuth 2.0 flow.';\n\ntype SecuritySectionParams = {\n inputs: ApiPlaygroundInputs;\n setInputs: (inputs: ApiPlaygroundInputs) => void;\n securityOptions: SecurityOption[];\n selectedSecurityOptionIndex: number;\n setSelectedSecurityOptionIndex: (index: number) => void;\n};\n\nexport const SecuritySection = ({\n inputs,\n setInputs,\n securityOptions,\n selectedSecurityOptionIndex,\n setSelectedSecurityOptionIndex,\n}: SecuritySectionParams) => {\n const selectedSecurityOption = securityOptions[selectedSecurityOptionIndex];\n\n const parameters = useMemo(() => {\n if (!selectedSecurityOption) return null;\n\n return (['header', 'query', 'cookie'] as const).flatMap((location) =>\n Object.entries(selectedSecurityOption.parameters[location]).map(([name, parameter]) => {\n const {\n schemaArray,\n transform,\n value: paramValue,\n } = getPropsForParameter(parameter, inputs[location][name]);\n\n const setParamValue = (paramValue: unknown) => {\n const newObj = {\n ...inputs,\n [location]: { ...inputs[location] },\n };\n newObj[location][name] = transform(paramValue);\n setInputs(newObj);\n };\n\n const clearParamValue =\n paramValue === undefined\n ? undefined\n : () => {\n const newObj = {\n ...inputs,\n [location]: { ...inputs[location] },\n };\n delete newObj[location][name];\n setInputs(newObj);\n };\n\n return (\n <RecursiveInput\n name={name}\n key={`${location}:${name}`}\n schemaArray={schemaArray}\n value={paramValue}\n setValue={setParamValue}\n clearValue={clearParamValue}\n />\n );\n })\n );\n }, [selectedSecurityOption, setInputs, inputs]);\n\n return (\n <InputSectionContainer\n name=\"Authorization\"\n rightElement={\n <div\n onClick={(e) => e.stopPropagation()}\n className={cn('mint:text-xs mint:font-mono', securityOptions.length <= 1 && 'mint:hidden')}\n >\n <TypeDropdown\n options={securityOptions.map((option) => ({\n label: option.title,\n \n schema: option as unknown as NoAnyDataSchema,\n }))}\n selectedIndex={selectedSecurityOptionIndex}\n onSelectOption={(index) => {\n setSelectedSecurityOptionIndex(index);\n }}\n />\n </div>\n }\n >\n {parameters}\n </InputSectionContainer>\n );\n};\n\nconst getPropsForParameter = (parameter: SecurityParameterSchema, value: unknown) => {\n return {\n schemaArray: getSchemaArrayForParameter(parameter),\n transform: getTransformForParameter(parameter),\n value: parseValueForParameter(parameter, value),\n };\n};\n\nconst getSchemaArrayForParameter = (parameter: SecurityParameterSchema): DataSchemaArray => {\n const description = getDescriptionForSecurityParameter(parameter);\n switch (parameter.type) {\n case 'apiKey':\n return [\n {\n type: 'string',\n required: true,\n description,\n \n default: parameter['x-default' as never],\n },\n ];\n case 'http':\n return parameter.scheme === 'basic'\n ? [\n {\n type: 'object',\n required: true,\n description,\n properties: {\n username: [{ type: 'string' }],\n password: [{ type: 'string' }],\n },\n additionalProperties: false,\n \n default: parameter['x-default' as never],\n },\n ]\n : [\n {\n type: 'string',\n required: true,\n format: 'bearer',\n description,\n \n default: parameter['x-default' as never],\n },\n ];\n case 'oauth2':\n return [\n {\n type: 'string',\n required: true,\n format: 'bearer',\n description,\n },\n ];\n }\n};\n\nexport const getDescriptionForSecurityParameter = (\n parameter: SecurityParameterSchema\n): string | undefined => {\n switch (parameter.type) {\n case 'apiKey':\n return parameter.description;\n case 'http':\n return (\n parameter.description ??\n (parameter.scheme === 'basic' ? basicDescription : bearerDescription)\n );\n case 'oauth2':\n return parameter.description ?? oauth2Description;\n }\n};\n\nconst parseValueForParameter = (parameter: SecurityParameterSchema, value: unknown) => {\n if (\n parameter.type !== 'http' ||\n parameter.scheme !== 'basic' ||\n typeof value !== 'string' ||\n !value.startsWith('Basic ')\n )\n return value;\n\n const encoded = value.slice('Basic '.length);\n const decoded = Buffer.from(encoded, 'base64').toString('utf-8');\n const [username, password] = decoded.split(':');\n return { username, password };\n};\n\nconst getTransformForParameter = (parameter: SecurityParameterSchema) => {\n if (parameter.type !== 'http' || parameter.scheme !== 'basic') {\n return (value: unknown) => value;\n }\n\n return (value: unknown) => {\n const username =\n value && typeof value === 'object' && 'username' in value ? value['username'] : undefined;\n const password =\n value && typeof value === 'object' && 'password' in value ? value['password'] : undefined;\n const unencoded = `${username ?? ''}:${password ?? ''}`;\n const encoded = Buffer.from(unencoded).toString('base64');\n return `Basic ${encoded}`;\n };\n};\n"],"names":["basicDescription","bearerDescription","oauth2Description","SecuritySection","inputs","setInputs","securityOptions","selectedSecurityOptionIndex","setSelectedSecurityOptionIndex","selectedSecurityOption","parameters","useMemo","location","name","parameter","schemaArray","transform","paramValue","getPropsForParameter","jsx","RecursiveInput","newObj","InputSectionContainer","e","cn","TypeDropdown","option","index","value","getSchemaArrayForParameter","getTransformForParameter","parseValueForParameter","description","getDescriptionForSecurityParameter","encoded","decoded","username","password","unencoded"],"mappings":";;;;;;;AAiBO,MAAMA,IACX,8IACWC,IACX,kGACWC,IACX,kFAUWC,IAAkB,CAAC;AAAA,EAC9B,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,6BAAAC;AAAA,EACA,gCAAAC;AACF,MAA6B;AAC3B,QAAMC,IAAyBH,EAAgBC,CAA2B,GAEpEG,IAAaC,EAAQ,MACpBF,IAEG,CAAC,UAAU,SAAS,QAAQ,EAAY;AAAA,IAAQ,CAACG,MACvD,OAAO,QAAQH,EAAuB,WAAWG,CAAQ,CAAC,EAAE,IAAI,CAAC,CAACC,GAAMC,CAAS,MAAM;AACrF,YAAM;AAAA,QACJ,aAAAC;AAAA,QACA,WAAAC;AAAA,QACA,OAAOC;AAAA,MAAA,IACLC,EAAqBJ,GAAWV,EAAOQ,CAAQ,EAAEC,CAAI,CAAC;AAuB1D,aACE,gBAAAM;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,MAAAP;AAAA,UAEA,aAAAE;AAAA,UACA,OAAOE;AAAA,UACP,UA3BkB,CAACA,MAAwB;AAC7C,kBAAMI,IAAS;AAAA,cACb,GAAGjB;AAAA,cACH,CAACQ,CAAQ,GAAG,EAAE,GAAGR,EAAOQ,CAAQ,EAAA;AAAA,YAAE;AAEpC,YAAAS,EAAOT,CAAQ,EAAEC,CAAI,IAAIG,EAAUC,CAAU,GAC7CZ,EAAUgB,CAAM;AAAA,UAClB;AAAA,UAqBI,YAlBFJ,MAAe,SACX,SACA,MAAM;AACJ,kBAAMI,IAAS;AAAA,cACb,GAAGjB;AAAA,cACH,CAACQ,CAAQ,GAAG,EAAE,GAAGR,EAAOQ,CAAQ,EAAA;AAAA,YAAE;AAEpC,mBAAOS,EAAOT,CAAQ,EAAEC,CAAI,GAC5BR,EAAUgB,CAAM;AAAA,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QAC5ES,IACJT,KAAS,OAAOA,KAAU,YAAY,cAAcA,IAAQA,EAAM,WAAc,QAC5EU,IAAY,GAAGF,KAAY,EAAE,IAAIC,KAAY,EAAE;AAErD,SAAO,SADS,OAAO,KAAKC,CAAS,EAAE,SAAS,QAAQ,CACjC;AACzB;"}
|
|
1
|
+
{"version":3,"file":"SecuritySection.js","sources":["../../../../src/api-playground/ApiPlayground/Request/SecuritySection.tsx"],"sourcesContent":["\nimport {\n ApiPlaygroundInputs,\n DataSchemaArray,\n SecurityOption,\n SecurityParameterSchema,\n} from '@mintlify/validation';\nimport { useMemo } from 'react';\n\nimport { NoAnyDataSchema } from '@/hooks/usePlaygroundSchemaOptions';\nimport { cn } from '@/api-playground-2/schemaGraph/utils';\n\nimport { InputSectionContainer } from '../components/InputSectionContainer';\nimport { TypeDropdown } from '../components/TypeDropdown';\nimport { RecursiveInput } from './inputs/RecursiveInput';\n\nexport const basicDescription =\n 'Basic authentication header of the form `Basic <encoded-value>`, where `<encoded-value>` is the base64-encoded string `username:password`.';\nexport const bearerDescription =\n 'Bearer authentication header of the form `Bearer <token>`, where `<token>` is your auth token.';\nexport const oauth2Description =\n 'The access token received from the authorization server in the OAuth 2.0 flow.';\n\ntype SecuritySectionParams = {\n inputs: ApiPlaygroundInputs;\n setInputs: (inputs: ApiPlaygroundInputs) => void;\n securityOptions: SecurityOption[];\n selectedSecurityOptionIndex: number;\n setSelectedSecurityOptionIndex: (index: number) => void;\n};\n\nexport const SecuritySection = ({\n inputs,\n setInputs,\n securityOptions,\n selectedSecurityOptionIndex,\n setSelectedSecurityOptionIndex,\n}: SecuritySectionParams) => {\n const selectedSecurityOption = securityOptions[selectedSecurityOptionIndex];\n\n const parameters = useMemo(() => {\n if (!selectedSecurityOption) return null;\n\n return (['header', 'query', 'cookie'] as const).flatMap((location) =>\n Object.entries(selectedSecurityOption.parameters[location]).map(([name, parameter]) => {\n const {\n schemaArray,\n transform,\n value: paramValue,\n } = getPropsForParameter(parameter, inputs[location][name]);\n\n const setParamValue = (paramValue: unknown) => {\n const newObj = {\n ...inputs,\n [location]: { ...inputs[location] },\n };\n newObj[location][name] = transform(paramValue);\n setInputs(newObj);\n };\n\n const clearParamValue =\n paramValue === undefined\n ? undefined\n : () => {\n const newObj = {\n ...inputs,\n [location]: { ...inputs[location] },\n };\n delete newObj[location][name];\n setInputs(newObj);\n };\n\n return (\n <RecursiveInput\n name={name}\n key={`${location}:${name}`}\n schemaArray={schemaArray}\n value={paramValue}\n setValue={setParamValue}\n clearValue={clearParamValue}\n />\n );\n })\n );\n }, [selectedSecurityOption, setInputs, inputs]);\n\n return (\n <InputSectionContainer\n name=\"Authorization\"\n rightElement={\n <div\n onClick={(e) => e.stopPropagation()}\n className={cn('mint:text-xs mint:font-mono', securityOptions.length <= 1 && 'mint:hidden')}\n >\n <TypeDropdown\n options={securityOptions.map((option) => ({\n label: option.title,\n \n schema: option as unknown as NoAnyDataSchema,\n }))}\n selectedIndex={selectedSecurityOptionIndex}\n onSelectOption={(index) => {\n setSelectedSecurityOptionIndex(index);\n }}\n />\n </div>\n }\n >\n {parameters}\n </InputSectionContainer>\n );\n};\n\nconst getPropsForParameter = (parameter: SecurityParameterSchema, value: unknown) => {\n return {\n schemaArray: getSchemaArrayForParameter(parameter),\n transform: getTransformForParameter(parameter),\n value: parseValueForParameter(parameter, value),\n };\n};\n\nconst getSchemaArrayForParameter = (parameter: SecurityParameterSchema): DataSchemaArray => {\n const description = getDescriptionForSecurityParameter(parameter);\n switch (parameter.type) {\n case 'apiKey':\n return [\n {\n type: 'string',\n required: true,\n description,\n \n default: parameter['x-default' as never],\n },\n ];\n case 'http':\n return parameter.scheme === 'basic'\n ? [\n {\n type: 'object',\n required: true,\n description,\n properties: {\n username: [{ type: 'string' }],\n password: [{ type: 'string' }],\n },\n additionalProperties: false,\n \n default: parameter['x-default' as never],\n },\n ]\n : [\n {\n type: 'string',\n required: true,\n format: 'bearer',\n description,\n \n default: parameter['x-default' as never],\n },\n ];\n case 'oauth2':\n return [\n {\n type: 'string',\n required: true,\n format: 'bearer',\n description,\n },\n ];\n }\n};\n\nexport const getDescriptionForSecurityParameter = (\n parameter: SecurityParameterSchema\n): string | undefined => {\n switch (parameter.type) {\n case 'apiKey':\n return parameter.description;\n case 'http':\n return (\n parameter.description ??\n (parameter.scheme === 'basic' ? basicDescription : bearerDescription)\n );\n case 'oauth2':\n return parameter.description ?? oauth2Description;\n }\n};\n\nconst parseValueForParameter = (parameter: SecurityParameterSchema, value: unknown) => {\n if (\n parameter.type !== 'http' ||\n parameter.scheme !== 'basic' ||\n typeof value !== 'string' ||\n !value.startsWith('Basic ')\n )\n return value;\n\n const encoded = value.slice('Basic '.length);\n const decoded = Buffer.from(encoded, 'base64').toString('utf-8');\n const [username, password] = decoded.split(':');\n return { username, password };\n};\n\nconst getTransformForParameter = (parameter: SecurityParameterSchema) => {\n if (parameter.type !== 'http' || parameter.scheme !== 'basic') {\n return (value: unknown) => value;\n }\n\n return (value: unknown) => {\n const username =\n value && typeof value === 'object' && 'username' in value ? value['username'] : undefined;\n const password =\n value && typeof value === 'object' && 'password' in value ? value['password'] : undefined;\n const unencoded = `${username ?? ''}:${password ?? ''}`;\n const encoded = Buffer.from(unencoded).toString('base64');\n return `Basic ${encoded}`;\n };\n};\n"],"names":["basicDescription","bearerDescription","oauth2Description","SecuritySection","inputs","setInputs","securityOptions","selectedSecurityOptionIndex","setSelectedSecurityOptionIndex","selectedSecurityOption","parameters","useMemo","location","name","parameter","schemaArray","transform","paramValue","getPropsForParameter","jsx","RecursiveInput","newObj","InputSectionContainer","e","cn","TypeDropdown","option","index","value","getSchemaArrayForParameter","getTransformForParameter","parseValueForParameter","description","getDescriptionForSecurityParameter","encoded","decoded","username","password","unencoded"],"mappings":";;;;;;;AAgBO,MAAMA,IACX,8IACWC,IACX,kGACWC,IACX,kFAUWC,IAAkB,CAAC;AAAA,EAC9B,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,6BAAA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playground/ApiPlayground/Request/ServerSection.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"ServerSection.js","sources":["../../../../src/api-playground/ApiPlayground/Request/ServerSection.tsx"],"sourcesContent":["\nimport { Server } from '@mintlify/validation';\nimport { useMemo } from 'react';\n\nimport { InputSectionContainer } from '../components/InputSectionContainer';\nimport { RecursiveInput } from './inputs/RecursiveInput';\n\ntype ServerSectionProps = {\n variables: NonNullable<Server['variables']>;\n value: Record<string, string>;\n setValue: (value: Record<string, string>) => void;\n};\n\nexport const ServerSection = ({ variables, value, setValue }: ServerSectionProps) => {\n const inputs = useMemo(() => {\n return Object.entries(variables).map(([key, schema]) => {\n const paramValue = value[key];\n const setParamValue = (newParamValue: unknown) => {\n const newObj = { ...value };\n newObj[key] = String(newParamValue);\n setValue(newObj);\n };\n const clearParamValue =\n paramValue === undefined\n ? undefined\n : () => {\n const newObj = { ...value };\n delete newObj[key];\n setValue(newObj);\n };\n\n return (\n <RecursiveInput\n key={key}\n name={key}\n schemaArray={[schema]}\n value={paramValue}\n setValue={setParamValue}\n clearValue={clearParamValue}\n />\n );\n });\n }, [variables, setValue, value]);\n\n return <InputSectionContainer name=\"Server\">{inputs}</InputSectionContainer>;\n};\n"],"names":["ServerSection","variables","value","setValue","inputs","useMemo","key","schema","paramValue","jsx","RecursiveInput","newParamValue","newObj","InputSectionContainer"],"mappings":";;;;AAaO,MAAMA,IAAgB,CAAC,EAAE,WAAAC,GAAW,OAAAC,GAAO,UAAAC,QAAmC;AACnF,QAAMC,IAASC,EAAQ,MACd,OAAO,QAAQJ,CAAS,EAAE,IAAI,CAAC,CAACK,GAAKC,CAAM,MAAM;AACtD,UAAMC,IAAaN,EAAMI,CAAG;AAe5B,WACE,gBAAAG;AAAA,MAACC;AAAA,MAAA;AAAA,QAEC,MAAMJ;AAAA,QACN,aAAa,CAACC,CAAM;AAAA,QACpB,OAAOC;AAAA,QACP,UApBkB,CAACG,MAA2B;AAChD,gBAAMC,IAAS,EAAE,GAAGV,EAAA;AACpB,UAAAU,EAAON,CAAG,IAAI,OAAOK,CAAa,GAClCR,EAASS,CAAM;AAAA,QACjB;AAAA,QAiBI,YAfFJ,MAAe,SACX,SACA,MAAM;AACJ,gBAAMI,IAAS,EAAE,GAAGV,EAAA;AACpB,iBAAOU,EAAON,CAAG,GACjBH,EAASS,CAAM;AAAA,QACjB;AAAA,MASU;AAAA,MALPN;AAAA,IAAA;AAAA,EAQX,CAAC,GACA,CAACL,GAAWE,GAAUD,CAAK,CAAC;AAE/B,SAAO,gBAAAO,EAACI,GAAA,EAAsB,MAAK,UAAU,UAAAT,GAAO;AACtD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/api-playground/ApiPlayground/Request/index.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/api-playground/ApiPlayground/Request/index.tsx"],"sourcesContent":["\nimport { ApiPlaygroundDisplayType } from '@mintlify/models';\nimport { ApiPlaygroundInputs, Endpoint } from '@mintlify/validation';\nimport { useContext } from 'react';\n\nimport { usePrefilledInputs } from '@/hooks/usePrefilledInputs';\nimport { useSecurityOption } from '@/hooks/useSecurityOption';\nimport ErrorBoundary from '@/components/Api/ErrorBoundary';\nimport { cn } from '@/api-playground-2/schemaGraph/utils';\n\nimport { ApiPlaygroundContext } from '../ApiPlaygroundContext';\nimport { EndpointHeader } from '../components/PathHeader';\nimport { PlaygroundModal } from './PlaygroundModal';\n\ntype RequestParams = {\n endpoint: Endpoint;\n inputs: ApiPlaygroundInputs;\n setInputs: (inputs: ApiPlaygroundInputs) => void;\n display: ApiPlaygroundDisplayType;\n pathname: string;\n};\n\nexport const Request = ({ endpoint, inputs, setInputs, display, pathname }: RequestParams) => {\n const { selectedBaseUrlIndex, setIsPlaygroundExpanded } = useContext(ApiPlaygroundContext);\n const server = endpoint.servers?.[selectedBaseUrlIndex];\n\n const securityOption = useSecurityOption(endpoint.request.security);\n usePrefilledInputs({\n inputs,\n setInputs,\n baseUrl: server?.url,\n securityOption,\n userInfoInputs: undefined,\n });\n\n return (\n <ErrorBoundary>\n <div\n className={cn(\n 'mint:flex mint:w-full mint:flex-col mint:bg-background-light mint:dark:bg-background-dark mint:border-standard mint:rounded-2xl',\n display === 'simple' ? 'mint:p-1' : 'mint:p-1.5'\n )}\n >\n <EndpointHeader\n endpoint={endpoint}\n display={display}\n onClickInteractive={() => setIsPlaygroundExpanded?.(true)}\n />\n <PlaygroundModal endpoint={endpoint} inputs={inputs} setInputs={setInputs} pathname={pathname} />\n </div>\n </ErrorBoundary>\n );\n};\n"],"names":["Request","endpoint","inputs","setInputs","display","pathname","selectedBaseUrlIndex","setIsPlaygroundExpanded","useContext","ApiPlaygroundContext","server","_a","securityOption","useSecurityOption","usePrefilledInputs","ErrorBoundary","jsxs","cn","jsx","EndpointHeader","PlaygroundModal"],"mappings":";;;;;;;;;;AAsBO,MAAMA,IAAU,CAAC,EAAE,UAAAC,GAAU,QAAAC,GAAQ,WAAAC,GAAW,SAAAC,GAAS,UAAAC,QAA8B;;AAC5F,QAAM,EAAE,sBAAAC,GAAsB,yBAAAC,MAA4BC,EAAWC,CAAoB,GACnFC,KAASC,IAAAV,EAAS,YAAT,gBAAAU,EAAmBL,IAE5BM,IAAiBC,EAAkBZ,EAAS,QAAQ,QAAQ;AAClE,SAAAa,EAAmB;AAAA,IACjB,QAAAZ;AAAA,IACA,WAAAC;AAAA,IACA,SAASO,KAAA,gBAAAA,EAAQ;AAAA,IACjB,gBAAAE;AAAA,IACA,gBAAgB;AAAA,EAAA,CACjB,qBAGEG,GAAA,EACC,UAAA,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC;AAAA,QACT;AAAA,QACAb,MAAY,WAAW,aAAa;AAAA,MAAA;AAAA,MAGtC,UAAA;AAAA,QAAA,gBAAAc;AAAA,UAACC;AAAA,UAAA;AAAA,YACC,UAAAlB;AAAA,YACA,SAAAG;AAAA,YACA,oBAAoB,MAAMG,KAAA,gBAAAA,EAA0B;AAAA,UAAI;AAAA,QAAA;AAAA,QAE1D,gBAAAW,EAACE,GAAA,EAAgB,UAAAnB,GAAoB,QAAAC,GAAgB,WAAAC,GAAsB,UAAAE,EAAA,CAAoB;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,GAEnG;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArrayInput.js","sources":["../../../../../src/api-playground/ApiPlayground/Request/inputs/ArrayInput.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"ArrayInput.js","sources":["../../../../../src/api-playground/ApiPlayground/Request/inputs/ArrayInput.tsx"],"sourcesContent":["\nimport { ArraySchema, IncrementalArraySchema } from '@mintlify/validation';\nimport { useMemo, useState } from 'react';\nimport { generateUniqueString } from '@/utils/uuid';\n\nimport { useGenerateNextItems } from '@/hooks/useGenerateNextItems';\nimport { AddRegular } from '@fluentui/react-icons';\nimport { cn } from '@/api-playground-2/schemaGraph/utils';\n\nimport { InputContainer } from '../../components/InputContainer';\nimport { RecursiveInput } from './RecursiveInput';\n\nexport const ArrayInput: RecursiveInput<ArraySchema | IncrementalArraySchema> = ({\n name,\n schema,\n typeDropdown,\n value,\n setValue,\n clearValue,\n depth,\n parentNames,\n}) => {\n const [childKeys, setChildKeys] = useState(value?.map(generateUniqueString) ?? []);\n const items = useGenerateNextItems(schema);\n\n const children = useMemo(() => {\n const elementInputs =\n value?.map((elemValue, i) => {\n const setElemValue = (newElemValue: unknown) => {\n const newArr = [...value];\n newArr[i] = newElemValue;\n setValue(newArr);\n };\n\n const clearElemValue = () => {\n const newArr = [...value];\n newArr.splice(i, 1);\n setChildKeys((prev) => {\n const newKeys = [...prev];\n newKeys.splice(i, 1);\n return newKeys;\n });\n setValue(newArr);\n };\n\n return (\n <RecursiveInput\n key={childKeys[i]}\n schemaArray={items}\n value={elemValue}\n setValue={setElemValue}\n clearValue={clearElemValue}\n depth={depth + 1}\n arrayIndex={i}\n />\n );\n }) ?? [];\n\n const onAddElement = () => {\n setChildKeys((prev) => [...prev, generateUniqueString()]);\n setValue([...(value ?? []), undefined]);\n };\n elementInputs.push(\n <AddAdditionalItemButton\n label=\"Add an item\"\n key=\"add-button\"\n className={cn(elementInputs.length > 0 && 'mint:mt-4')}\n onClick={onAddElement}\n dataTestId={name + '-add-item-button'}\n />\n );\n return elementInputs;\n }, [childKeys, items, value, setValue, depth, name]);\n\n return (\n <InputContainer\n name={name}\n typeDropdown={typeDropdown}\n schema={schema}\n onClear={clearValue}\n parentNames={parentNames}\n isArray\n >\n {children}\n </InputContainer>\n );\n};\n\nexport function AddAdditionalItemButton({\n className,\n onClick,\n label,\n dataTestId,\n}: {\n className?: string;\n onClick: () => void;\n label: string;\n dataTestId?: string;\n}) {\n return (\n <div className={className}>\n <button\n aria-label={label}\n className=\"mint:flex mint:text-playground-input mint:w-fit mint:items-center mint:gap-x-1.5 mint:py-1! mint:px-2! mint:hover:bg-gray-50 mint:dark:hover:bg-white/[0.03] mint:cursor-pointer\"\n onClick={onClick}\n data-testid={dataTestId}\n >\n <AddRegular className=\"mint:h-3 mint:w-3\" />\n <span className=\"mint:text-gray-600 mint:dark:text-gray-200\">{label}</span>\n </button>\n </div>\n );\n}\n"],"names":["ArrayInput","name","schema","typeDropdown","value","setValue","clearValue","depth","parentNames","childKeys","setChildKeys","useState","generateUniqueString","items","useGenerateNextItems","children","useMemo","elementInputs","elemValue","i","jsx","RecursiveInput","newElemValue","newArr","prev","newKeys","onAddElement","AddAdditionalItemButton","cn","InputContainer","className","onClick","label","dataTestId","jsxs","AddRegular"],"mappings":";;;;;;;;;AAYO,MAAMA,IAAmE,CAAC;AAAA,EAC/E,MAAAC;AAAA,EACA,QAAAC;AAAA,EACA,cAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AACF,MAAM;AACJ,QAAM,CAACC,GAAWC,CAAY,IA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AEnD,SACE,gBAAAmB;AAAA,IAACS;AAAA,IAAA;AAAA,MACC,MAAA5B;AAAA,MACA,cAAAE;AAAA,MACA,QAAAD;AAAA,MACA,SAASI;AAAA,MACT,aAAAE;AAAA,MACA,SAAO;AAAA,MAEN,UAAAO;AAAA,IAAA;AAAA,EAAA;AAGP;AAEO,SAASY,EAAwB;AAAA,EACtC,WAAAG;AAAA,EACA,SAAAC;AAAA,EACA,OAAAC;AAAA,EACA,YAAAC;AACF,GAKG;AACD,SACE,gBAAAb,EAAC,SAAI,WAAAU,GACH,UAAA,gBAAAI;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,cAAYF;AAAA,MACZ,WAAU;AAAA,MACV,SAAAD;AAAA,MACA,eAAaE;AAAA,MAEb,UAAA;AAAA,QAAA,gBAAAb,EAACe,GAAA,EAAW,WAAU,oBAAA,CAAoB;AAAA,QAC1C,gBAAAf,EAAC,QAAA,EAAK,WAAU,8CAA8C,UAAAY,EAAA,CAAM;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,GAExE;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileInput.js","sources":["../../../../../src/api-playground/ApiPlayground/Request/inputs/FileInput.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"FileInput.js","sources":["../../../../../src/api-playground/ApiPlayground/Request/inputs/FileInput.tsx"],"sourcesContent":["\nimport { FileSchema } from '@mintlify/validation';\nimport { useRef } from 'react';\n\nimport { useSelectedLocale } from '@/utils/locales';\nimport { cn } from '@/api-playground-2/schemaGraph/utils';\n\nimport { InputContainer } from '../../components/InputContainer';\nimport { GenericInput } from './RecursiveInput';\n\nexport const FileInput: GenericInput<FileSchema> = ({\n name,\n schema,\n typeDropdown,\n value,\n setValue,\n clearValue,\n parentNames,\n arrayIndex,\n}) => {\n const locale = useSelectedLocale();\n const hiddenInputRef = useRef<HTMLInputElement>(null);\n\n return (\n <InputContainer\n name={name}\n typeDropdown={typeDropdown}\n schema={schema}\n onClear={clearValue}\n parentNames={parentNames}\n arrayIndex={arrayIndex}\n >\n <button\n aria-label={locale['aria.fileUploadButton']}\n className={cn(\n 'mint:text-left mint:flex mint:text-playground-input mint:overflow-hidden',\n value ? 'mint:text-gray-900! mint:dark:text-gray-100!' : 'mint:text-gray-400! mint:dark:text-white/30!'\n )}\n onClick={() => hiddenInputRef.current?.click()}\n >\n {value?.name ?? schema.placeholder ?? 'Drop a file here or click to upload'}\n </button>\n {/* HACK: file inputs are notoriously hard to style, so hide the native input and click it programmatically */}\n <input\n type=\"file\"\n data-testid=\"file-input\"\n onChange={(event) => setValue(event.target.files?.[0])}\n ref={hiddenInputRef}\n className=\"mint:hidden\"\n />\n </InputContainer>\n );\n};\n"],"names":["FileInput","name","schema","typeDropdown","value","setValue","clearValue","parentNames","arrayIndex","locale","useSelectedLocale","hiddenInputRef","useRef","jsxs","InputContainer","jsx","cn","_a","event"],"mappings":";;;;;;AAUO,MAAMA,IAAsC,CAAC;AAAA,EAClD,MAAAC;AAAA,EACA,QAAAC;AAAA,EACA,cAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AAAA,EACA,aAAAC;AAAA,EACA,YAAAC;AACF,MAAM;AACJ,QAAMC,IAASC,EAAA,GACTC,IAAiBC,EAAyB,IAAI;AAEpD,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAAb;AAAA,MACA,cAAAE;AAAA,MACA,QAAAD;AAAA,MACA,SAASI;AAAA,MACT,aAAAC;AAAA,MACA,YAAAC;AAAA,MAEA,UAAA;AAAA,QAAA,gBAAAO;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,cAAYN,EAAO,uBAAuB;AAAA,YAC1C,WAAWO;AAAA,cACT;AAAA,cACAZ,IAAQ,iDAAiD;AAAA,YAAA;AAAA,YAE3D,SAAS,MAAA;;AAAM,sBAAAa,IAAAN,EAAe,YAAf,gBAAAM,EAAwB;AAAA;AAAA,YAEtC,WAAAb,KAAA,gBAAAA,EAAO,SAAQF,EAAO,eAAe;AAAA,UAAA;AAAA,QAAA;AAAA,QAGxC,gBAAAa;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,eAAY;AAAA,YACZ,UAAU,CAACG;;AAAU,qBAAAb,GAASY,IAAAC,EAAM,OAAO,UAAb,gBAAAD,EAAqB,EAAE;AAAA;AAAA,YACrD,KAAKN;AAAA,YACL,WAAU;AAAA,UAAA;AAAA,QAAA;AAAA,MACZ;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NullInput.js","sources":["../../../../../src/api-playground/ApiPlayground/Request/inputs/NullInput.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"NullInput.js","sources":["../../../../../src/api-playground/ApiPlayground/Request/inputs/NullInput.tsx"],"sourcesContent":["\nimport { NullSchema } from '@mintlify/validation';\n\nimport { InputContainer } from '../../components/InputContainer';\nimport { GenericInput } from './RecursiveInput';\nimport { cn } from \"../../../../utils/cn\";\n\nexport const NullInput: GenericInput<NullSchema> = ({\n name,\n schema,\n typeDropdown,\n clearValue,\n parentNames,\n arrayIndex,\n}) => {\n return (\n <InputContainer\n name={name}\n typeDropdown={typeDropdown}\n schema={schema}\n onClear={clearValue}\n parentNames={parentNames}\n arrayIndex={arrayIndex}\n >\n <input\n className=\"mint:flex-1 mint:min-w-0 mint:outline-0 mint:bg-transparent mint:text-playground-input\"\n type=\"text\"\n placeholder=\"--\"\n contentEditable=\"false\"\n disabled\n />\n </InputContainer>\n );\n};\n"],"names":["NullInput","name","schema","typeDropdown","clearValue","parentNames","arrayIndex","jsx","InputContainer"],"mappings":";;AAOO,MAAMA,IAAsC,CAAC;AAAA,EAClD,MAAAC;AAAA,EACA,QAAAC;AAAA,EACA,cAAAC;AAAA,EACA,YAAAC;AAAA,EACA,aAAAC;AAAA,EACA,YAAAC;AACF,MAEI,gBAAAC;AAAA,EAACC;AAAA,EAAA;AAAA,IACC,MAAAP;AAAA,IACA,cAAAE;AAAA,IACA,QAAAD;AAAA,IACA,SAASE;AAAA,IACT,aAAAC;AAAA,IACA,YAAAC;AAAA,IAEA,UAAA,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAU;AAAA,QACV,MAAK;AAAA,QACL,aAAY;AAAA,QACZ,iBAAgB;AAAA,QAChB,UAAQ;AAAA,MAAA;AAAA,IAAA;AAAA,EACV;AAAA;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberInput.js","sources":["../../../../../src/api-playground/ApiPlayground/Request/inputs/NumberInput.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"NumberInput.js","sources":["../../../../../src/api-playground/ApiPlayground/Request/inputs/NumberInput.tsx"],"sourcesContent":["\nimport { NumberSchema } from '@mintlify/validation';\nimport { ChangeEvent, useCallback } from 'react';\n\nimport { useSelectedLocale } from '@/utils/locales';\n\nimport { InputContainer } from '../../components/InputContainer';\nimport { GenericInput } from './RecursiveInput';\nimport { Ids } from '@/api-playground-2/types';\nimport { cn } from \"../../../../utils/cn\";\n\nexport const NumberInput: GenericInput<NumberSchema> = ({\n name,\n typeDropdown,\n schema,\n value,\n setValue,\n clearValue,\n arrayIndex,\n ...sharedProps\n}) => {\n const locale = useSelectedLocale();\n const onChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n if (event.target.value.length === 0) {\n setValue(undefined);\n return;\n }\n\n if (schema.type === 'integer') {\n const parsedInteger = parseInt(event.target.value);\n if (isNaN(parsedInteger)) {\n return;\n }\n setValue(parsedInteger);\n } else {\n setValue(parseFloat(event.target.value));\n }\n },\n [setValue, schema.type]\n );\n\n return (\n <InputContainer\n name={name}\n typeDropdown={typeDropdown}\n schema={schema}\n onClear={clearValue}\n parentNames={sharedProps.parentNames}\n arrayIndex={arrayIndex}\n >\n <input\n id={Ids.APIPlaygroundInput}\n className=\"mint:flex-1 mint:min-w-0 mint:bg-transparent mint:outline-0 mint:text-playground-input\"\n placeholder={schema.placeholder ?? `enter ${name ?? 'value'}`}\n aria-label={\n schema.placeholder ?? locale['aria.enterValue'].replace('{name}', name ?? 'value')\n }\n onKeyDown={(event) => {\n // disallow \"e\", and disallow \".\" for integer inputs\n if (event.key === 'e' || (event.key === '.' && schema.type === 'integer')) {\n event.preventDefault();\n }\n }}\n type=\"number\"\n value={value ?? ''}\n onChange={onChange}\n />\n </InputContainer>\n );\n};\n"],"names":["NumberInput","name","typeDropdown","schema","value","setValue","clearValue","arrayIndex","sharedProps","locale","useSelectedLocale","onChange","useCallback","event","parsedInteger","jsx","InputContainer","Ids"],"mappings":";;;;;AAWO,MAAMA,IAA0C,CAAC;AAAA,EACtD,MAAAC;AAAA,EACA,cAAAC;AAAA,EACA,QAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AAAA,EACA,YAAAC;AAAA,EACA,GAAGC;AACL,MAAM;AACJ,QAAMC,IAASC,EAAA,GACTC,IAAWC;AAAA,IACf,CAACC,MAAyC;AACxC,UAAIA,EAAM,OAAO,MAAM,WAAW,GAAG;AACnC,QAAAR,EAAS,MAAS;AAClB;AAAA,MACF;AAEA,UAAIF,EAAO,SAAS,WAAW;AAC7B,cAAMW,IAAgB,SAASD,EAAM,OAAO,KAAK;AACjD,YAAI,MAAMC,CAAa;AACrB;AAEF,QAAAT,EAASS,CAAa;AAAA,MACxB;AACE,QAAAT,EAAS,WAAWQ,EAAM,OAAO,KAAK,CAAC;AAAA,IAE3C;AAAA,IACA,CAACR,GAAUF,EAAO,IAAI;AAAA,EAAA;AAGxB,SACE,gBAAAY;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAAf;AAAA,MACA,cAAAC;AAAA,MACA,QAAAC;AAAA,MACA,SAASG;AAAA,MACT,aAAaE,EAAY;AAAA,MACzB,YAAAD;AAAA,MAEA,UAAA,gBAAAQ;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,IAAIE,EAAI;AAAA,UACR,WAAU;AAAA,UACV,aAAad,EAAO,eAAe,SAASF,KAAQ,OAAO;AAAA,UAC3D,cACEE,EAAO,eAAeM,EAAO,iBAAiB,EAAE,QAAQ,UAAUR,KAAQ,OAAO;AAAA,UAEnF,WAAW,CAACY,MAAU;AAEpB,aAAIA,EAAM,QAAQ,OAAQA,EAAM,QAAQ,OAAOV,EAAO,SAAS,cAC7DU,EAAM,eAAA;AAAA,UAEV;AAAA,UACA,MAAK;AAAA,UACL,OAAOT,KAAS;AAAA,UAChB,UAAAO;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAGN;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectInput.js","sources":["../../../../../src/api-playground/ApiPlayground/Request/inputs/ObjectInput.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"ObjectInput.js","sources":["../../../../../src/api-playground/ApiPlayground/Request/inputs/ObjectInput.tsx"],"sourcesContent":["\nimport { IncrementalObjectSchema, ObjectSchema } from '@mintlify/validation';\nimport { useMemo, useState } from 'react';\nimport { generateUniqueString } from '@/utils/uuid';\n\nimport { useGenerateNextAdditionalProperties } from '@/hooks/useGenerateNextAdditionalProperties';\nimport { useGenerateNextProperties } from '@/hooks/useGenerateNextProperties';\n\nimport { AdditionalPropertyButton } from '../../components/AdditionalPropertyButton';\nimport { InputContainer } from '../../components/InputContainer';\nimport { calculateObjectInputChildren } from './ObjectChildren';\nimport { RecursiveInput } from './RecursiveInput';\n\nexport const ObjectInput: RecursiveInput<ObjectSchema | IncrementalObjectSchema> = ({\n name,\n schema,\n typeDropdown,\n setValue,\n clearValue,\n value,\n depth,\n parentNames,\n arrayIndex,\n defaultExpanded,\n style,\n explode,\n renderedRefs,\n}) => {\n const [additionalPropButtonKey, setAdditionalPropButtonKey] = useState(generateUniqueString());\n const allowsAdditionalProperties = schema.additionalProperties !== false;\n const existingKeys = [...Object.keys(value ?? {}), ...Object.keys(schema.properties)];\n\n const properties = useGenerateNextProperties(schema);\n const additionalProperties = useGenerateNextAdditionalProperties(schema);\n\n const refIdentifier = schema.refIdentifier;\n\n const inputs: React.ReactNode[] = useMemo(\n () =>\n calculateObjectInputChildren({\n properties,\n additionalProperties,\n value,\n setValue,\n name,\n parentNames,\n defaultExpanded,\n depth,\n refId: refIdentifier,\n refs: new Set(renderedRefs),\n style,\n explode,\n }),\n [\n additionalProperties,\n defaultExpanded,\n depth,\n name,\n parentNames,\n properties,\n refIdentifier,\n renderedRefs,\n setValue,\n value,\n style,\n explode,\n ]\n );\n\n if (depth === 0) {\n return inputs;\n }\n\n const addKey = (key: string) => {\n const newObj = { ...value };\n newObj[key] = undefined;\n setValue(newObj);\n setAdditionalPropButtonKey(generateUniqueString());\n };\n\n return (\n <InputContainer\n name={name}\n typeDropdown={typeDropdown}\n schema={schema}\n onClear={clearValue}\n isObject\n parentNames={parentNames}\n arrayIndex={arrayIndex}\n defaultExpanded={defaultExpanded}\n style={style}\n explode={explode}\n >\n {inputs}\n {allowsAdditionalProperties ? (\n <AdditionalPropertyButton\n key={additionalPropButtonKey}\n onAddKey={addKey}\n existingKeys={existingKeys}\n dataTestId={name + '-additional-property-button'}\n />\n ) : null}\n </InputContainer>\n );\n};\n"],"names":["ObjectInput","name","schema","typeDropdown","setValue","clearValue","value","depth","parentNames","arrayIndex","defaultExpanded","style","explode","renderedRefs","additionalPropButtonKey","setAdditionalPropButtonKey","useState","generateUniqueString","allowsAdditionalProperties","existingKeys","properties","useGenerateNextProperties","additionalProperties","useGenerateNextAdditionalProperties","refIdentifier","inputs","useMemo","calculateObjectInputChildren","jsxs","InputContainer","jsx","AdditionalPropertyButton","key","newObj"],"mappings":";;;;;;;;AAaO,MAAMA,IAAsE,CAAC;AAAA,EAClF,MAAAC;AAAA,EACA,QAAAC;AAAA,EACA,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AAAA,EACA,OAAAC;AAAA,EACA,OAAAC;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AAgB;AAC9B,oBAAMC,IAAS,EAAE,GAAG3B,EAAA;AACpB,cAAA2B,EAAOD,CAAG,IAAI,QACd5B,EAAS6B,CAAM,GACflB,EAA2BE,GAAsB;AAAA,YACnD;AAAA,YAoBQ,cAAAE;AAAA,YACA,YAAYlB,IAAO;AAAA,UAAA;AAAA,UAHda;AAAA,QAAA,IAKL;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGV;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RecursiveInput.js","sources":["../../../../../src/api-playground/ApiPlayground/Request/inputs/RecursiveInput.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"RecursiveInput.js","sources":["../../../../../src/api-playground/ApiPlayground/Request/inputs/RecursiveInput.tsx"],"sourcesContent":["\nimport {\n ArraySchema,\n DataSchema,\n DataSchemaArray,\n IncrementalArraySchema,\n IncrementalDataSchema,\n IncrementalDataSchemaArray,\n IncrementalObjectSchema,\n ObjectSchema,\n} from '@mintlify/validation';\nimport { ReactNode, useCallback, useState } from 'react';\n\nimport { useApiPlaygroundPrefillExamples } from '@/hooks/useApiPlaygroundPrefillExamples';\nimport { usePlaygroundSchemaOptions } from '@/hooks/usePlaygroundSchemaOptions';\nimport ErrorBoundary from '@/components/Api/ErrorBoundary';\n\nimport { TypeDropdown } from '../../components/TypeDropdown';\nimport { DifferentiatedInput } from './DifferentiatedInput';\nimport { RenderedRefs } from '@/api-playground-2/types/api';\n\ntype GenericInputParams<T extends IncrementalDataSchema | DataSchema, K = T['example']> = {\n name?: string;\n schema: T;\n typeDropdown: ReactNode;\n value: K;\n setValue: (value: K) => void;\n clearValue: (() => void) | undefined;\n parentNames?: string[];\n arrayIndex?: number;\n defaultExpanded?: boolean;\n style?: string;\n explode?: boolean;\n renderedRefs?: RenderedRefs;\n};\n\nexport type GenericInput<T extends DataSchema | IncrementalDataSchema> = React.FC<\n GenericInputParams<T>\n>;\nexport type RecursiveInput<\n T extends IncrementalObjectSchema | ObjectSchema | IncrementalArraySchema | ArraySchema,\n> = React.FC<GenericInputParams<T> & { depth: number }>;\n\ntype RecursiveInputParams = {\n name?: string;\n schemaArray: DataSchemaArray | IncrementalDataSchemaArray;\n value: unknown | undefined;\n setValue: (value: unknown) => void;\n clearValue: (() => void) | undefined;\n isBody?: boolean;\n depth?: number;\n parentNames?: string[];\n arrayIndex?: number;\n defaultExpanded?: boolean;\n style?: string;\n explode?: boolean;\n renderedRefs?: RenderedRefs;\n};\n\nexport const RecursiveInput = ({\n name,\n value,\n schemaArray,\n setValue,\n clearValue,\n isBody,\n depth = 0,\n parentNames,\n arrayIndex,\n defaultExpanded,\n style,\n explode,\n renderedRefs = new Set(),\n}: RecursiveInputParams) => {\n const [selectedSchemaIndex, setSelectedSchemaIndex] = useState(0);\n const schemasWithLabelInfo = usePlaygroundSchemaOptions(schemaArray);\n const selectedSchema = schemasWithLabelInfo[selectedSchemaIndex]?.schema;\n const { prefillExamplesEnabled } = useApiPlaygroundPrefillExamples();\n const prefillDisabled = prefillExamplesEnabled;\n\n const onSelectTypeOption = useCallback(\n (index: number) => {\n if (schemasWithLabelInfo[index]?.schema.type === 'null') {\n setValue(null);\n } else {\n setValue(undefined);\n }\n setSelectedSchemaIndex(index);\n },\n [schemasWithLabelInfo, setValue]\n );\n\n const typeDropdown = (\n <TypeDropdown\n options={schemasWithLabelInfo}\n selectedIndex={selectedSchemaIndex}\n onSelectOption={onSelectTypeOption}\n />\n );\n\n if (selectedSchema === undefined) return null;\n\n return (\n <ErrorBoundary>\n <DifferentiatedInput\n name={name}\n schema={selectedSchema}\n typeDropdown={typeDropdown}\n value={value}\n setValue={setValue}\n clearValue={clearValue}\n isBody={isBody}\n depth={depth}\n parentNames={parentNames}\n arrayIndex={arrayIndex}\n defaultExpanded={defaultExpanded}\n style={style}\n explode={explode}\n renderedRefs={renderedRefs}\n prefillDisabled={prefillDisabled}\n />\n </ErrorBoundary>\n );\n};\n"],"names":["RecursiveInput","name","value","schemaArray","setValue","clearValue","isBody","depth","parentNames","arrayIndex","defaultExpanded","style","explode","renderedRefs","selectedSchemaIndex","setSelectedSchemaIndex","useState","schemasWithLabelInfo","usePlaygroundSchemaOptions","selectedSchema","_a","prefillExamplesEnabled","useApiPlaygroundPrefillExamples","prefillDisabled","onSelectTypeOption","useCallback","index","typeDropdown","jsx","TypeDropdown","ErrorBoundary","DifferentiatedInput"],"mappings":";;;;;;;AA2DO,MAAMA,IAAiB,CAAC;AAAA,EAC7B,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AAAA,EACA,QAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,aAAAC;AAAA,EACA,YAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,OAAAC;AAAA,EACA,SAAAC;AAAA,EACA,cAAAC,wBAAmB,IAAA;AACrB,MAA4B;;AAC1B,QAAM,CAACC,GAAqBC,CAAsB,IAAIC,EAAS,CAAC,GAC1DC,IAAuBC,EAA2Bf,CAAW,GAC7DgB,KAAiBC,IAAAH,EAAqBH,CAAmB,MAAxC,gBAAAM,EAA2C,QAC5D,EAAE,wBAAAC,EAAA,IAA2BC,EAAA,GAC7BC,IAAkBF,GAElBG,IAAqBC;AAAA,IACzB,CAACC,MAAkB;;AACjB,QAAIN,IAAAH,EAAqBS,CAAK,MAA1B,gBAAAN,EAA6B,OAAO,UAAS,SAC/ChB,EAAS,IAAI,IAEbA,EAAS,MAAS,GAEpBW,EAAuBW,CAAK;AAAA,IAC9B;AAAA,IACA,CAACT,GAAsBb,CAAQ;AAAA,EAAA,GAG3BuB,IACJ,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,SAASZ;AAAA,MACT,eAAeH;AAAA,MACf,gBAAgBU;AAAA,IAAA;AAAA,EAAA;AAIpB,SAAIL,MAAmB,SAAkB,yBAGtCW,GAAA,EACC,UAAA,gBAAAF;AAAA,IAACG;AAAA,IAAA;AAAA,MACC,MAAA9B;AAAA,MACA,QAAQkB;AAAA,MACR,cAAAQ;AAAA,MACA,OAAAzB;AAAA,MACA,UAAAE;AAAA,MACA,YAAAC;AAAA,MACA,QAAAC;AAAA,MACA,OAAAC;AAAA,MACA,aAAAC;AAAA,MACA,YAAAC;AAAA,MACA,iBAAAC;AAAA,MACA,OAAAC;AAAA,MACA,SAAAC;AAAA,MACA,cAAAC;AAAA,MACA,iBAAAU;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectInput.js","sources":["../../../../../src/api-playground/ApiPlayground/Request/inputs/SelectInput.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"SelectInput.js","sources":["../../../../../src/api-playground/ApiPlayground/Request/inputs/SelectInput.tsx"],"sourcesContent":["\nimport { BooleanSchema, NumberEnumSchema, StringEnumSchema } from '@mintlify/validation';\nimport { ChevronDownFilled } from '@fluentui/react-icons'; \n\nimport { useSelectedLocale } from '@/utils/locales';\nimport { getXFilteredEnumValues } from '@/openapi/filterEnums';\nimport { cn } from '@/api-playground-2/schemaGraph/utils';\n\nimport { InputContainer } from '../../components/InputContainer';\nimport { GenericInput } from './RecursiveInput';\n\nexport const SelectInput: GenericInput<NumberEnumSchema | StringEnumSchema | BooleanSchema> = ({\n name,\n schema,\n typeDropdown,\n value,\n setValue,\n clearValue,\n parentNames,\n arrayIndex,\n}) => {\n const locale = useSelectedLocale();\n const options =\n schema.type === 'boolean' ? [true, false] : getXFilteredEnumValues({ schema, userGroups: undefined });\n\n return (\n <InputContainer\n name={name}\n typeDropdown={typeDropdown}\n schema={schema}\n onClear={clearValue}\n parentNames={parentNames}\n arrayIndex={arrayIndex}\n >\n <div className=\"mint:relative\">\n <select\n className={cn(\n 'mint:relative mint:text-playground-input mint:w-full mint:text-left mint:flex-1 mint:outline-0 mint:cursor-pointer mint:bg-transparent',\n value !== undefined\n ? 'mint:text-gray-900! mint:dark:text-gray-100!'\n : 'mint:text-gray-400! mint:dark:text-white/30!'\n )}\n value={value?.toString() ?? ''}\n aria-label={\n schema.placeholder ?? locale['aria.selectOption'].replace('{name}', name || 'option')\n }\n onChange={(e) => {\n if (schema.type === 'boolean') {\n setValue(e.target.value === 'true');\n } else {\n setValue(e.target.value);\n }\n }}\n >\n <option value=\"\" disabled>\n {schema.placeholder ?? `select ${name || 'option'}`}\n </option>\n {options.map((opt) => (\n <option key={opt.toString()} value={opt.toString()}>\n {opt.toString()}\n </option>\n ))}\n </select>\n <ChevronDownFilled className=\"mint:absolute mint:right-2 mint:top-1/2 mint:-translate-y-1/2 mint:h-4 mint:w-4 mint:text-gray-400 mint:dark:text-white/30 mint:pointer-events-none\" />\n </div>\n </InputContainer>\n );\n};\n"],"names":["SelectInput","name","schema","typeDropdown","value","setValue","clearValue","parentNames","arrayIndex","locale","useSelectedLocale","options","getXFilteredEnumValues","jsx","InputContainer","jsxs","cn","opt","ChevronDownFilled"],"mappings":";;;;;;;AAWO,MAAMA,IAAiF,CAAC;AAAA,EAC7F,MAAAC;AAAA,EACA,QAAAC;AAAA,EACA,cAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AAAA,EACA,aAAAC;AAAA,EACA,YAAAC;AACF,MAAM;AACJ,QAAMC,IAASC,EAAA,GACTC,IACJT,EAAO,SAAS,YAAY,CAAC,IAAM,EAAK,IAAIU,EAAuB,EAAE,QAAAV,GAAQ,YAAY,QAAW;AAEtG,SACE,gBAAAW;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAAb;AAAA,MACA,cAAAE;AAAA,MACA,QAAAD;AAAA,MACA,SAASI;AAAA,MACT,aAAAC;AAAA,MACA,YAAAC;AAAA,MAEA,UAAA,gBAAAO,EAAC,OAAA,EAAI,WAAU,iBACb,UAAA;AAAA,QAAA,gBAAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAWC;AAAA,cACT;AAAA,cACAZ,MAAU,SACN,iDACA;AAAA,YAAA;AAAA,YAEN,QAAOA,KAAA,gBAAAA,EAAO,eAAc;AAAA,YAC5B,cACEF,EAAO,eAAeO,EAAO,mBAAmB,EAAE,QAAQ,UAAUR,KAAQ,QAAQ;AAAA,YAEtF,UAAU,CAAC,MAAM;AACf,cAAIC,EAAO,SAAS,YAClBG,EAAS,EAAE,OAAO,UAAU,MAAM,IAElCA,EAAS,EAAE,OAAO,KAAK;AAAA,YAE3B;AAAA,YAEA,UAAA;AAAA,cAAA,gBAAAQ,EAAC,UAAA,EAAO,OAAM,IAAG,UAAQ,IACtB,YAAO,eAAe,UAAUZ,KAAQ,QAAQ,GAAA,CACnD;AAAA,cACCU,EAAQ,IAAI,CAACM,MACZ,gBAAAJ,EAAC,YAA4B,OAAOI,EAAI,SAAA,GACrC,YAAI,SAAA,EAAS,GADHA,EAAI,UAEjB,CACD;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,QAEH,gBAAAJ,EAACK,GAAA,EAAkB,WAAU,sJAAA,CAAsJ;AAAA,MAAA,EAAA,CACrL;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StringInput.js","sources":["../../../../../src/api-playground/ApiPlayground/Request/inputs/StringInput.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"StringInput.js","sources":["../../../../../src/api-playground/ApiPlayground/Request/inputs/StringInput.tsx"],"sourcesContent":["\nimport { StringSchema } from '@mintlify/validation';\nimport { useCallback } from 'react';\n\nimport { useSelectedLocale } from '@/utils/locales';\n\nimport { InputContainer } from '../../components/InputContainer';\nimport { GenericInput } from './RecursiveInput';\nimport { Ids } from '@/api-playground-2/types';\nimport { cn } from \"../../../../utils/cn\";\n\nexport const StringInput: GenericInput<StringSchema> = ({\n name,\n schema,\n typeDropdown,\n value,\n setValue,\n clearValue,\n parentNames,\n arrayIndex,\n style,\n explode,\n}) => {\n const locale = useSelectedLocale();\n const { prefix, placeholder } = getInputAttributesForFormat(schema.format);\n\n // remove modifications\n const unmodifiedValue =\n prefix && value?.startsWith(prefix) ? value.substring(prefix.length) : value;\n\n const setModifiedValue = useCallback(\n (newValue: string) => {\n // apply modifications\n const modifiedValue = `${prefix ?? ''}${newValue}`;\n\n if (!modifiedValue) setValue(undefined);\n else setValue(modifiedValue);\n },\n [setValue, prefix]\n );\n\n return (\n <InputContainer\n name={name}\n typeDropdown={typeDropdown}\n schema={schema}\n onClear={clearValue}\n parentNames={parentNames}\n arrayIndex={arrayIndex}\n style={style}\n explode={explode}\n >\n <div className=\"mint:relative mint:flex mint:flex-1 mint:items-center\">\n <div className=\"mint:absolute mint:left-2.5 mint:top-0 mint:bottom-0 mint:flex mint:items-center mint:justify-center mint:text-sm mint:text-gray-800 mint:dark:text-gray-100\">\n {prefix}\n </div>\n <input\n id={Ids.APIPlaygroundInput}\n className=\"mint:flex-1 mint:min-w-0 mint:bg-transparent mint:outline-0 mint:text-playground-input\"\n style={{ paddingLeft: prefix ? prefix.length * 0.52 + 'rem' : undefined }}\n placeholder={schema.placeholder ?? placeholder ?? `enter ${name ?? 'value'}`}\n aria-label={\n schema.placeholder ??\n placeholder ??\n locale['aria.enterValue'].replace('{name}', name ?? 'value')\n }\n type=\"text\"\n value={unmodifiedValue ?? ''}\n onChange={(event) => setModifiedValue(event.target.value)}\n spellCheck={false}\n />\n </div>\n </InputContainer>\n );\n};\n\ntype InputAttributes = {\n prefix?: string;\n placeholder?: string;\n};\n\nconst getInputAttributesForFormat = (format: string | undefined): InputAttributes => {\n switch (format?.toLowerCase()) {\n case 'bearer':\n return {\n prefix: 'Bearer ',\n placeholder: 'enter bearer token',\n };\n }\n return {};\n};\n"],"names":["StringInput","name","schema","typeDropdown","value","setValue","clearValue","parentNames","arrayIndex","style","explode","locale","useSelectedLocale","prefix","placeholder","getInputAttributesForFormat","unmodifiedValue","setModifiedValue","useCallback","newValue","modifiedValue","jsx","InputContainer","jsxs","Ids","event","format"],"mappings":";;;;;AAW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B;AAAA,YAC1B,UAAU,CAACS,MAAUR,EAAiBQ,EAAM,OAAO,KAAK;AAAA,YACxD,YAAY;AAAA,UAAA;AAAA,QAAA;AAAA,MACd,EAAA,CACF;AAAA,IAAA;AAAA,EAAA;AAGN,GAOMV,IAA8B,CAACW,MAAgD;AACnF,UAAQA,KAAA,gBAAAA,EAAQ,eAAY;AAAA,IAC1B,KAAK;AACH,aAAO;AAAA,QACL,QAAQ;AAAA,QACR,aAAa;AAAA,MAAA;AAAA,EACf;AAEJ,SAAO,CAAA;AACT;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInput.js","sources":["../../../../../src/api-playground/ApiPlayground/Request/inputs/TextInput.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"TextInput.js","sources":["../../../../../src/api-playground/ApiPlayground/Request/inputs/TextInput.tsx"],"sourcesContent":["\nimport { StringSchema } from '@mintlify/validation';\n\nimport { useSelectedLocale } from '@/utils/locales';\n\nimport { InputContainer } from '../../components/InputContainer';\nimport { GenericInput } from './RecursiveInput';\nimport { cn } from \"../../../../utils/cn\";\n\nexport const TextInput: GenericInput<StringSchema> = ({\n name,\n schema,\n typeDropdown,\n value,\n setValue,\n clearValue,\n parentNames,\n arrayIndex,\n}) => {\n const locale = useSelectedLocale();\n\n return (\n <InputContainer\n name={name}\n typeDropdown={typeDropdown}\n schema={schema}\n onClear={clearValue}\n parentNames={parentNames}\n arrayIndex={arrayIndex}\n >\n <textarea\n className=\"mint:-mx-3.5 mint:px-3.5 mint:flex-1 mint:min-h-[2.5rem] mint:min-w-0 mint:bg-transparent mint:outline-0 mint:text-playground-input mint:resize-y\"\n rows={2}\n placeholder={schema.placeholder ?? `Enter ${name ?? 'value'}`}\n aria-label={\n schema.placeholder ?? locale['aria.enterValue'].replace('{name}', name ?? 'value')\n }\n value={value}\n onChange={(event) => setValue(event.target.value)}\n spellCheck={false}\n autoCapitalize=\"off\"\n autoComplete=\"off\"\n autoCorrect=\"off\"\n />\n </InputContainer>\n );\n};\n"],"names":["TextInput","name","schema","typeDropdown","value","setValue","clearValue","parentNames","arrayIndex","locale","useSelectedLocale","jsx","InputContainer","event"],"mappings":";;;AASO,MAAMA,IAAwC,CAAC;AAAA,EACpD,MAAAC;AAAA,EACA,QAAAC;AAAA,EACA,cAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AAAA,EACA,aAAAC;AAAA,EACA,YAAAC;AACF,MAAM;AACJ,QAAMC,IAASC,EAAA;AAEf,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAAX;AAAA,MACA,cAAAE;AAAA,MACA,QAAAD;AAAA,MACA,SAASI;AAAA,MACT,aAAAC;AAAA,MACA,YAAAC;AAAA,MAEA,UAAA,gBAAAG;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAU;AAAA,UACV,MAAM;AAAA,UACN,aAAaT,EAAO,eAAe,SAASD,KAAQ,OAAO;AAAA,UAC3D,cACEC,EAAO,eAAeO,EAAO,iBAAiB,EAAE,QAAQ,UAAUR,KAAQ,OAAO;AAAA,UAEnF,OAAAG;AAAA,UACA,UAAU,CAACS,MAAUR,EAASQ,EAAM,OAAO,KAAK;AAAA,UAChD,YAAY;AAAA,UACZ,gBAAe;AAAA,UACf,cAAa;AAAA,UACb,aAAY;AAAA,QAAA;AAAA,MAAA;AAAA,IACd;AAAA,EAAA;AAGN;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CopyFileToClipboardButton.js","sources":["../../../../src/api-playground/ApiPlayground/Response/CopyFileToClipboardButton.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"CopyFileToClipboardButton.js","sources":["../../../../src/api-playground/ApiPlayground/Response/CopyFileToClipboardButton.tsx"],"sourcesContent":["\nimport { CopyDataToClipboardButton } from '@/components/content-components/code-block';\n\nimport { ResponseBodyData } from '.';\n\ntype CopyFileToClipboardButtonParams = {\n data: ResponseBodyData;\n};\n\nexport const CopyFileToClipboardButton = ({ data }: CopyFileToClipboardButtonParams) => {\n return <CopyDataToClipboardButton data={data} showTooltip={false} />;\n};\n"],"names":["CopyFileToClipboardButton","data","jsx","CopyDataToClipboardButton"],"mappings":";;AASO,MAAMA,IAA4B,CAAC,EAAE,MAAAC,QACnC,gBAAAC,EAACC,GAAA,EAA0B,MAAAF,GAAY,aAAa,GAAA,CAAO;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DownloadFileButton.js","sources":["../../../../src/api-playground/ApiPlayground/Response/DownloadFileButton.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"DownloadFileButton.js","sources":["../../../../src/api-playground/ApiPlayground/Response/DownloadFileButton.tsx"],"sourcesContent":["\nimport { useState } from 'react';\n\nimport { CodeBlockTooltip } from '../../../components/content-components/code-group';\nimport { useSelectedLocale } from '@/utils/locales';\nimport { CheckmarkCircleRegular, ArrowDownRegular } from '@fluentui/react-icons';\nimport { cn } from '@/api-playground-2/schemaGraph/utils';\n\nimport { ResponseBodyData } from '.';\n\ntype DownloadButtonParams = {\n data: ResponseBodyData;\n};\n\nexport const DownloadButton = ({ data }: DownloadButtonParams) => {\n const [isCopiedActive, setIsCopiedActive] = useState(false);\n const locale = useSelectedLocale();\n const onClick = () => {\n setIsCopiedActive(true);\n setTimeout(() => {\n setIsCopiedActive(false);\n }, 2000);\n };\n\n return data.extension ? (\n <a\n aria-label={\n isCopiedActive ? locale['aria.fileDownloaded'] : locale['aria.downloadResponseFile']\n }\n className=\"mint:group mint:h-7 mint:w-7 mint:flex mint:items-center mint:justify-center mint:cursor-pointer mint:relative\"\n onClick={onClick}\n href={data.url}\n download={`api-response.${data.extension}`}\n >\n {isCopiedActive ? (\n <CheckmarkCircleRegular\n className=\"mint:h-4 mint:w-4 mint:bg-primary mint:dark:bg-primary-light\"\n />\n ) : (\n <ArrowDownRegular\n className={cn(\n 'mint:w-4 mint:h-4',\n 'mint:bg-gray-400 mint:group-hover:bg-gray-500 mint:dark:bg-white/40 mint:dark:group-hover:bg-white/60'\n )} \n />\n )}\n <CodeBlockTooltip text={isCopiedActive ? 'Copied!' : 'Download'} />\n </a>\n ) : null;\n};\n"],"names":["DownloadButton","data","isCopiedActive","setIsCopiedActive","useState","locale","useSelectedLocale","onClick","jsxs","jsx","CheckmarkCircleRegular","ArrowDownRegular","cn","CodeBlockTooltip"],"mappings":";;;;;;;AAcO,MAAMA,IAAiB,CAAC,EAAE,MAAAC,QAAiC;AAChE,QAAM,CAACC,GAAgBC,CAAiB,IAAIC,EAAS,EAAK,GACpDC,IAASC,EAAA,GACTC,IAAU,MAAM;AACpB,IAAAJ,EAAkB,EAAI,GACtB,WAAW,MAAM;AACf,MAAAA,EAAkB,EAAK;AAAA,IACzB,GAAG,GAAI;AAAA,EACT;AAEA,SAAOF,EAAK,YACV,gBAAAO;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,cACEN,IAAiBG,EAAO,qBAAqB,IAAIA,EAAO,2BAA2B;AAAA,MAErF,WAAU;AAAA,MACV,SAAAE;AAAA,MACA,MAAMN,EAAK;AAAA,MACX,UAAU,gBAAgBA,EAAK,SAAS;AAAA,MAEvC,UAAA;AAAA,QAAAC,IACC,gBAAAO;AAAA,UAACC;AAAA,UAAA;AAAA,YACC,WAAU;AAAA,UAAA;AAAA,QAAA,IAGZ,gBAAAD;AAAA,UAACE;AAAA,UAAA;AAAA,YACC,WAAWC;AAAA,cACT;AAAA,cACA;AAAA,YAAA;AAAA,UACF;AAAA,QAAA;AAAA,QAGJ,gBAAAH,EAACI,GAAA,EAAiB,MAAMX,IAAiB,YAAY,WAAA,CAAY;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,IAEjE;AACN;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeResponseContent.js","sources":["../../../../../src/api-playground/ApiPlayground/Response/ResponseBody/CodeResponseContent.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"CodeResponseContent.js","sources":["../../../../../src/api-playground/ApiPlayground/Response/ResponseBody/CodeResponseContent.tsx"],"sourcesContent":["\nimport { useMemo } from 'react';\nimport Prism from 'prismjs';\nimport 'prismjs/components/prism-json.js';\n\nimport { MAX_PREVIEW_BYTES } from '@/constants';\nimport { useSelectedLocale } from '@/utils/locales';\nimport { cn } from '@/api-playground-2/schemaGraph/utils';\nimport { getCodeBlockScrollbarClassname } from '@/utils/getScrollbarClassname';\n\nimport type { OtherResponseData } from '..';\n\ntype CodeResponseContentParams = {\n data: OtherResponseData;\n};\n\nexport const CodeResponseContent = ({ data }: CodeResponseContentParams) => {\n const locale = useSelectedLocale();\n\n let isJson = false;\n let jsonData = data.content;\n const wayTooLarge = data.content.length > MAX_PREVIEW_BYTES * 5;\n\n try {\n jsonData = JSON.parse(data.content);\n isJson = true;\n } catch (e) {\n console.error(e);\n }\n\n const html = useMemo(() => {\n if (!isJson) return undefined;\n\n try {\n const codeString = JSON.stringify(jsonData, null, 2);\n const grammar = Prism.languages.json || Prism.languages.plaintext;\n return Prism.highlight(codeString, grammar, 'json');\n } catch (error) {\n console.error('Failed to highlight code:', error);\n return undefined;\n }\n }, [isJson, jsonData]);\n\n return (\n <div\n tabIndex={0}\n role=\"region\"\n aria-label={locale['aria.responseContent']}\n className='mint:overflow-auto mint:h-full'\n >\n <div\n className={cn(\n 'mint:px-3 mint:py-3.5 mint:h-full mint:whitespace-pre mint:border-gray-200 mint:dark:border-gray-700 mint:dark:text-gray-300 mint:font-mono mint:text-xs mint:leading-5',\n wayTooLarge && 'mint:whitespace-pre-line'\n )}\n >\n {isJson && html !== undefined ? (\n <span suppressHydrationWarning dangerouslySetInnerHTML={{ __html: html }} />\n ) : (\n // Fallback: show prettified JSON (without syntax highlighting) when response is too large\n <span suppressHydrationWarning>\n {isJson ? JSON.stringify(jsonData, null, 2) : data.content}\n </span>\n )}\n </div>\n </div>\n );\n};\n"],"names":["CodeResponseContent","data","locale","useSelectedLocale","isJson","jsonData","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,EAAA;AAGN;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/api-playground/ApiPlayground/Response/ResponseBody/index.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/api-playground/ApiPlayground/Response/ResponseBody/index.tsx"],"sourcesContent":["\nimport { ResponseBodyData } from '..';\nimport { ResponsePlaceholder } from '../ResponsePlaceholder';\n\nimport { CodeResponseContent } from './CodeResponseContent';\n\n\ntype ResponseBodyParams = {\n data: ResponseBodyData | undefined;\n};\n\nexport const ResponseBody = ({ data }: ResponseBodyParams) => {\n if (data == null) {\n return (\n <ResponsePlaceholder message=\"No body data received from the server\" icon=\"brackets-curly\" />\n );\n }\n\n switch (data.type) {\n case 'other':\n return <CodeResponseContent data={data} />;\n }\n};\n"],"names":["ResponseBody","data","jsx","ResponsePlaceholder","CodeResponseContent"],"mappings":";;;AAWO,MAAMA,IAAe,CAAC,EAAE,MAAAC,QAA+B;AAC5D,MAAIA,KAAQ;AACV,WACE,gBAAAC,EAACC,GAAA,EAAoB,SAAQ,yCAAwC,MAAK,kBAAiB;AAI/F,UAAQF,EAAK,MAAA;AAAA,IACX,KAAK;AACH,aAAO,gBAAAC,EAACE,KAAoB,MAAAH,GAAY;AAAA,EAAA;AAE9C;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResponseError.js","sources":["../../../../src/api-playground/ApiPlayground/Response/ResponseError.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"ResponseError.js","sources":["../../../../src/api-playground/ApiPlayground/Response/ResponseError.tsx"],"sourcesContent":["\nimport { ResponsePlaceholder } from './ResponsePlaceholder';\nimport { WarningRegular } from '@fluentui/react-icons';\nimport { cn } from \"../../../utils/cn\";\n\nexport const ResponseError = ({ message }: { message: string }) => {\n return (\n <ResponsePlaceholder\n message={`An error occurred while making the request: ${message}`}\n icon={<WarningRegular className=\"mint:h-8 mint:w-8 mint:bg-gray-300 mint:dark:bg-white/20\" />}\n />\n );\n};\n"],"names":["ResponseError","message","jsx","ResponsePlaceholder","WarningRegular"],"mappings":";;;AAKO,MAAMA,IAAgB,CAAC,EAAE,SAAAC,QAE5B,gBAAAC;AAAA,EAACC;AAAA,EAAA;AAAA,IACC,SAAS,+CAA+CF,CAAO;AAAA,IAC/D,MAAM,gBAAAC,EAACE,GAAA,EAAe,WAAU,2DAAA,CAA2D;AAAA,EAAA;AAAA;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResponseHeaders.js","sources":["../../../../src/api-playground/ApiPlayground/Response/ResponseHeaders.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"ResponseHeaders.js","sources":["../../../../src/api-playground/ApiPlayground/Response/ResponseHeaders.tsx"],"sourcesContent":["\nimport { ApiPlaygroundResponseType } from '@mintlify/models';\nimport { TableRegular } from '@fluentui/react-icons';\n\nimport { ResponsePlaceholder } from './ResponsePlaceholder';\nimport { ResponseTable } from './ResponseTable';\nimport { cn } from \"../../../utils/cn\";\n\nexport const ResponseHeaders = ({ response }: { response: ApiPlaygroundResponseType }) => {\n const headers = Object.entries(response.headers);\n if (headers.length === 0) {\n return <ResponsePlaceholder message=\"No headers received from the server\" icon={<TableRegular className=\"mint:h-8 mint:w-8 mint:bg-gray-300 mint:dark:bg-white/20\" />} />;\n }\n\n return <ResponseTable data={headers} />;\n};\n"],"names":["ResponseHeaders","response","headers","jsx","ResponsePlaceholder","TableRegular","ResponseTable"],"mappings":";;;;AAQO,MAAMA,IAAkB,CAAC,EAAE,UAAAC,QAAwD;AACxF,QAAMC,IAAU,OAAO,QAAQD,EAAS,OAAO;AAC/C,SAAIC,EAAQ,WAAW,IACd,gBAAAC,EAACC,KAAoB,SAAQ,uCAAsC,MAAM,gBAAAD,EAACE,GAAA,EAAa,WAAU,2DAAA,CAA2D,EAAA,CAAI,IAGlK,gBAAAF,EAACG,GAAA,EAAc,MAAMJ,EAAA,CAAS;AACvC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResponsePlaceholder.js","sources":["../../../../src/api-playground/ApiPlayground/Response/ResponsePlaceholder.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"ResponsePlaceholder.js","sources":["../../../../src/api-playground/ApiPlayground/Response/ResponsePlaceholder.tsx"],"sourcesContent":["\nimport { cn } from '@/api-playground-2/schemaGraph/utils';\n\nexport const ResponsePlaceholder = ({ message, icon }: { message: string, icon?: React.ReactNode }) => {\n\n return (\n <div\n className={cn(\n 'mint:bg-response-body-auto',\n 'mint:rounded-b-xl mint:overflow-auto'\n )}\n >\n <div className=\"mint:pb-8 mint:pt-10 mint:px-6 mint:space-y-4 mint:flex mint:flex-col mint:items-center\">\n {icon}\n <div className=\"mint:text-sm mint:text-center\">{message}</div>\n </div>\n </div>\n );\n};\n"],"names":["ResponsePlaceholder","message","icon","jsx","cn","jsxs"],"mappings":";;;AAGO,MAAMA,IAAsB,CAAC,EAAE,SAAAC,GAAS,MAAAC,QAG3C,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWC;AAAA,MACT;AAAA,MACA;AAAA,IAAA;AAAA,IAGF,UAAA,gBAAAC,EAAC,OAAA,EAAI,WAAU,2FACZ,UAAA;AAAA,MAAAH;AAAA,MACD,gBAAAC,EAAC,OAAA,EAAI,WAAU,iCAAiC,UAAAF,EAAA,CAAQ;AAAA,IAAA,EAAA,CAC1D;AAAA,EAAA;AAAA;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResponseTable.js","sources":["../../../../src/api-playground/ApiPlayground/Response/ResponseTable.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"ResponseTable.js","sources":["../../../../src/api-playground/ApiPlayground/Response/ResponseTable.tsx"],"sourcesContent":["\nimport { cn } from '@/api-playground-2/schemaGraph/utils';\n\nexport const ResponseTable = ({ data }: { data: [string, unknown][] }) => {\n\n return (\n <div className=\"mint:w-full mint:rounded-b-xl mint:overflow-y-auto\">\n <table className=\"mint:table-fixed mint:pb-8 mint:w-full mint:pt-10\">\n {data.flatMap(([key, value]) => {\n return (\n <tr\n className={cn(\n 'mint:w-full mint:flex mint:divide-x mint:border-b mint:last:border-b-0 mint:text-xs mint:text-gray-600 mint:dark:text-gray-400',\n 'mint:divide-gray-100 mint:dark:divide-white/10 mint:border-gray-100 mint:dark:border-white/10'\n )}\n key={key}\n >\n <td className=\"mint:flex mint:items-center mint:basis-1/2 mint:py-2 mint:px-4 mint:overflow-x-autotext-gray-600\">\n <div className=\"mint:min-w-max\">{key}</div>\n </td>\n <td className=\"mint:flex mint:items-center mint:basis-1/2 mint:py-2 mint:px-4 mint:overflow-x-auto\">\n <div className=\"mint:min-w-max\">{`${value}`}</div>\n </td>\n </tr>\n );\n })}\n </table>\n </div>\n );\n};\n"],"names":["ResponseTable","data","jsx","key","value","jsxs","cn"],"mappings":";;;AAGO,MAAMA,IAAgB,CAAC,EAAE,MAAAC,QAG5B,gBAAAC,EAAC,OAAA,EAAI,WAAU,sDACb,4BAAC,SAAA,EAAM,WAAU,qDACd,UAAAD,EAAK,QAAQ,CAAC,CAACE,GAAKC,CAAK,MAEtB,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWC;AAAA,MACT;AAAA,MACA;AAAA,IAAA;AAAA,IAIF,UAAA;AAAA,MAAA,gBAAAJ,EAAC,MAAA,EAAG,WAAU,oGACZ,UAAA,gBAAAA,EAAC,SAAI,WAAU,kBAAkB,aAAI,EAAA,CACvC;AAAA,MACA,gBAAAA,EAAC,MAAA,EAAG,WAAU,uFACZ,UAAA,gBAAAA,EAAC,OAAA,EAAI,WAAU,kBAAkB,UAAA,GAAGE,CAAK,GAAA,CAAG,EAAA,CAC9C;AAAA,IAAA;AAAA,EAAA;AAAA,EAPKD;AAAA,CAUV,GACH,GACF;"}
|