@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.
Files changed (106) hide show
  1. package/dist/api-playground/ApiPlayground/ApiPlaygroundContext.js.map +1 -1
  2. package/dist/api-playground/ApiPlayground/Request/BodySection.js.map +1 -1
  3. package/dist/api-playground/ApiPlayground/Request/ParameterSection.js.map +1 -1
  4. package/dist/api-playground/ApiPlayground/Request/PlaygroundModal.js.map +1 -1
  5. package/dist/api-playground/ApiPlayground/Request/SecuritySection.js.map +1 -1
  6. package/dist/api-playground/ApiPlayground/Request/ServerSection.js.map +1 -1
  7. package/dist/api-playground/ApiPlayground/Request/index.js.map +1 -1
  8. package/dist/api-playground/ApiPlayground/Request/inputs/ArrayInput.js.map +1 -1
  9. package/dist/api-playground/ApiPlayground/Request/inputs/FileInput.js.map +1 -1
  10. package/dist/api-playground/ApiPlayground/Request/inputs/NullInput.js.map +1 -1
  11. package/dist/api-playground/ApiPlayground/Request/inputs/NumberInput.js.map +1 -1
  12. package/dist/api-playground/ApiPlayground/Request/inputs/ObjectInput.js.map +1 -1
  13. package/dist/api-playground/ApiPlayground/Request/inputs/RecursiveInput.js.map +1 -1
  14. package/dist/api-playground/ApiPlayground/Request/inputs/SelectInput.js.map +1 -1
  15. package/dist/api-playground/ApiPlayground/Request/inputs/StringInput.js.map +1 -1
  16. package/dist/api-playground/ApiPlayground/Request/inputs/TextInput.js.map +1 -1
  17. package/dist/api-playground/ApiPlayground/Response/CopyFileToClipboardButton.js.map +1 -1
  18. package/dist/api-playground/ApiPlayground/Response/DownloadFileButton.js.map +1 -1
  19. package/dist/api-playground/ApiPlayground/Response/ResponseBody/CodeResponseContent.js.map +1 -1
  20. package/dist/api-playground/ApiPlayground/Response/ResponseBody/index.js.map +1 -1
  21. package/dist/api-playground/ApiPlayground/Response/ResponseError.js.map +1 -1
  22. package/dist/api-playground/ApiPlayground/Response/ResponseHeaders.js.map +1 -1
  23. package/dist/api-playground/ApiPlayground/Response/ResponsePlaceholder.js.map +1 -1
  24. package/dist/api-playground/ApiPlayground/Response/ResponseTable.js.map +1 -1
  25. package/dist/api-playground/ApiPlayground/Response/ResponseTopbar.js.map +1 -1
  26. package/dist/api-playground/ApiPlayground/Response/index.js.map +1 -1
  27. package/dist/api-playground/ApiPlayground/components/AdditionalPropertyButton.js.map +1 -1
  28. package/dist/api-playground/ApiPlayground/components/ArrayCount.js.map +1 -1
  29. package/dist/api-playground/ApiPlayground/components/EndpointsMenuLink.js.map +1 -1
  30. package/dist/api-playground/ApiPlayground/components/InputContainer.js.map +1 -1
  31. package/dist/api-playground/ApiPlayground/components/InputSectionContainer.js.map +1 -1
  32. package/dist/api-playground/ApiPlayground/components/ObjectExpandButton.js.map +1 -1
  33. package/dist/api-playground/ApiPlayground/components/PathHeader.js.map +1 -1
  34. package/dist/api-playground/ApiPlayground/components/PlaygroundModalWrapper.js.map +1 -1
  35. package/dist/api-playground/ApiPlayground/components/TrashButton.js.map +1 -1
  36. package/dist/api-playground/ApiPlayground/components/TypeDropdown.js.map +1 -1
  37. package/dist/api-playground/ApiPlayground/index.js.map +1 -1
  38. package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/NumberMetadata.js.map +1 -1
  39. package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/StringMetadata.js.map +1 -1
  40. package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/index.js.map +1 -1
  41. package/dist/api-playground/EndpointFields/ParamFields/RecursiveParamField.js.map +1 -1
  42. package/dist/api-playground/EndpointFields/components/Description.js.map +1 -1
  43. package/dist/api-playground/EndpointFields/components/OneOfDropdown.js.map +1 -1
  44. package/dist/api-playground/EndpointFields/components/OptionDropdown.js.map +1 -1
  45. package/dist/api-playground/EndpointFields/components/SectionHeading.js.map +1 -1
  46. package/dist/api-playground/EndpointFields/index.js.map +1 -1
  47. package/dist/api-playground-2/Api.js.map +1 -1
  48. package/dist/api-playground-2/ApiExamples.js.map +1 -1
  49. package/dist/api-playground-2/ApiFields.js.map +1 -1
  50. package/dist/api-playground-2/components/EndpointFields/EndpointSecurity.js.map +1 -1
  51. package/dist/api-playground-2/components/EndpointFields/fields/NumberMetadata.js.map +1 -1
  52. package/dist/api-playground-2/components/EndpointFields/fields/PrimitiveParamField.js.map +1 -1
  53. package/dist/api-playground-2/components/EndpointFields/fields/SimpleArrayParamField.js.map +1 -1
  54. package/dist/api-playground-2/components/EndpointFields/fields/SimpleObjectParamField.js.map +1 -1
  55. package/dist/api-playground-2/components/EndpointFields/fields/SimplePrimitiveParamField.js.map +1 -1
  56. package/dist/api-playground-2/components/EndpointFields/fields/StringMetadata.js.map +1 -1
  57. package/dist/api-playground-2/components/Example/RequestExample.js +17 -15
  58. package/dist/api-playground-2/components/Example/RequestExample.js.map +1 -1
  59. package/dist/api-playground-2/components/Example/ResponseExample.js.map +1 -1
  60. package/dist/api-playground-2/components/Request/InputSectionContainer.js.map +1 -1
  61. package/dist/api-playground-2/components/TypeDropdown.js.map +1 -1
  62. package/dist/api-playground-2/contexts/ApiPlaygroundContext.js.map +1 -1
  63. package/dist/api-playground-2/generators/generateInteractiveCodeSample.js +10 -10
  64. package/dist/api-playground-2/generators/generateInteractiveCodeSample.js.map +1 -1
  65. package/dist/api-playground-2/generators/generateSnippetMap.js +24 -24
  66. package/dist/api-playground-2/generators/generateSnippetMap.js.map +1 -1
  67. package/dist/api-playground-2/hooks/useSendPlaygroundRequest.js.map +1 -1
  68. package/dist/components/Api/ErrorBoundary.js.map +1 -1
  69. package/dist/components/Api/Expandable.js.map +1 -1
  70. package/dist/components/Api/Markdown.js.map +1 -1
  71. package/dist/components/Api/MethodPill.js.map +1 -1
  72. package/dist/components/Api/Param.js.map +1 -1
  73. package/dist/components/Api/colors.js.map +1 -1
  74. package/dist/components/content-components/CodeGroupSelect/CodeGroupCopyButton.js.map +1 -1
  75. package/dist/components/content-components/CodeGroupSelect/CodeSelectDropdown.js.map +1 -1
  76. package/dist/components/content-components/CodeGroupSelect/index.js.map +1 -1
  77. package/dist/components/content-components/code-block.js.map +1 -1
  78. package/dist/components/content-components/code-group.js.map +1 -1
  79. package/dist/components/content-components/code-snippet.js.map +1 -1
  80. package/dist/components/content-components/code-snippets.js.map +1 -1
  81. package/dist/components/content-components/getNodeText.js.map +1 -1
  82. package/dist/components/docsLayout.js +29 -27
  83. package/dist/components/docsLayout.js.map +1 -1
  84. package/dist/components/nav-tree/index.js +174 -178
  85. package/dist/components/nav-tree/index.js.map +1 -1
  86. package/dist/contexts/CodeExampleLabelContext.js.map +1 -1
  87. package/dist/contexts/ConfigContext.js.map +1 -1
  88. package/dist/contexts/EndpointLocationContext.js.map +1 -1
  89. package/dist/contexts/MDXContentContext.js.map +1 -1
  90. package/dist/hooks/useApiPlaygroundDisplay.js.map +1 -1
  91. package/dist/hooks/useApiPlaygroundInputs.js.map +1 -1
  92. package/dist/hooks/useBaseUrlOptions.js.map +1 -1
  93. package/dist/hooks/useEndpoint.js.map +1 -1
  94. package/dist/hooks/useKeyboardShortcut.js.map +1 -1
  95. package/dist/hooks/useMDXContent.js.map +1 -1
  96. package/dist/hooks/useMDXContentController/useApiPlaygroundInputs.js.map +1 -1
  97. package/dist/hooks/useMDXContentController/useMDXContentCallbacks/useSetApiBaseIndexCallback.js.map +1 -1
  98. package/dist/hooks/useMDXContentController/useMDXContentCallbacks/useSetApiPlaygroundInputsCallback.js.map +1 -1
  99. package/dist/hooks/usePlaygroundSchemaOptions.js.map +1 -1
  100. package/dist/hooks/usePrefilledInputs/index.js.map +1 -1
  101. package/dist/hooks/usePrefilledInputs/storedServerVariables.js.map +1 -1
  102. package/dist/hooks/useSecurityOption.js.map +1 -1
  103. package/dist/hooks/useSendPlaygroundRequest.js.map +1 -1
  104. package/dist/index.d.ts +4 -2
  105. package/dist/styles.css +1 -1
  106. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ConfigContext.js","sources":["../../src/contexts/ConfigContext.tsx"],"sourcesContent":["'use client';\n\nimport type { MdxExtracts } from '@mintlify/common';\nimport { SerializeSuccess } from '@mintlify/mdx/types';\nimport { InkeepType, MintConfig, PageMetaTags } from '@mintlify/models';\nimport { PageType } from '@mintlify/models';\nimport {\n DeploymentEntitlements,\n GitSource,\n DeploymentFeedbackType,\n DocsConfig,\n DecoratedNavigationConfig,\n TrieveType,\n DeploymentPreviewType,\n} from '@mintlify/validation';\nimport { createContext, ReactNode } from 'react';\n\nimport { addApiReferenceDataFromMdxAndDocsConfig } from '@/api-playground-2/schemaGraph/addApiReferenceDataFromMdxAndDocsConfig';\nimport { processSecurityOptions } from '@/api-playground-2/schemaGraph/processSecurityOptions';\nimport type { ApiReferenceDataV2 } from '@/api-playground-2/types';\nimport { ApiReferenceData } from '../utils/api-reference/getApiReferenceData';\n\nexport type PageContextType = {\n pageMetadata: PageMetaTags;\n pageType?: PageType;\n mdxExtracts?: MdxExtracts;\n description?: SerializeSuccess | string | null;\n panelMdxSource?: SerializeSuccess;\n panelMdxSourceWithNoJs?: SerializeSuccess;\n pathname?: string;\n};\n\nexport type DeploymentMetadataContextType = {\n subdomain?: string;\n actualSubdomain?: string;\n gitSource?: GitSource;\n inkeep?: InkeepType;\n trieve?: TrieveType;\n feedback?: DeploymentFeedbackType;\n entitlements?: DeploymentEntitlements;\n buildId?: string;\n clientVersion?: string;\n preview?: DeploymentPreviewType;\n};\n\nexport type DocsConfigContextType = {\n mintConfig?: MintConfig;\n docsConfig?: DocsConfig;\n docsNavWithMetadata?: DecoratedNavigationConfig;\n};\n\nexport type ApiReferenceContextType = {\n apiReferenceData: ApiReferenceData;\n};\n\nexport type ApiReferenceContext2Type = {\n apiReferenceData2: ApiReferenceDataV2;\n};\n\nexport type ApiReferenceProvider2Props = {\n pageMetadata: PageMetaTags;\n docsConfig: DocsConfig | undefined;\n mdxExtracts: MdxExtracts | undefined;\n apiReferenceData2: ApiReferenceDataV2 | undefined;\n children: ReactNode;\n};\n\nexport const PageContext = createContext<PageContextType>({ pageMetadata: {} });\n\nexport const DeploymentMetadataContext = createContext<DeploymentMetadataContextType>({});\n\nexport const DocsConfigContext = createContext<DocsConfigContextType>({});\n\nexport const ApiReferenceContext = createContext<ApiReferenceContextType>({ apiReferenceData: {} });\n\nexport const ApiReferenceContext2 = createContext<ApiReferenceContext2Type>({\n apiReferenceData2: {},\n});\n\nPageContext.displayName = 'PageContext';\nDeploymentMetadataContext.displayName = 'DeploymentMetadataContext';\nDocsConfigContext.displayName = 'DocsConfigContext';\nApiReferenceContext.displayName = 'ApiReferenceContext';\n\nexport function PageProvider({ value, children }: { value: PageContextType; children: ReactNode }) {\n return <PageContext.Provider value={value}>{children}</PageContext.Provider>;\n}\n\nexport function DeploymentMetadataProvider({\n value,\n children,\n}: {\n value: DeploymentMetadataContextType;\n children: ReactNode;\n}) {\n return (\n <DeploymentMetadataContext.Provider value={value}>\n {children}\n </DeploymentMetadataContext.Provider>\n );\n}\n\nexport function DocsConfigProvider({\n value,\n children,\n}: {\n value: DocsConfigContextType;\n children: ReactNode;\n}) {\n return <DocsConfigContext.Provider value={value}>{children}</DocsConfigContext.Provider>;\n}\n\nexport function ApiReferenceProvider({\n value,\n children,\n}: {\n value: ApiReferenceContextType;\n children: ReactNode;\n}) {\n return <ApiReferenceContext.Provider value={value}>{children}</ApiReferenceContext.Provider>;\n}\n\nexport function ApiReferenceProvider2({\n pageMetadata,\n docsConfig,\n mdxExtracts,\n apiReferenceData2,\n children,\n}: ApiReferenceProvider2Props) {\n // combine apiReferenceData2 from page props with mdxExtracts and docsConfig so we don't\n // have to go hunting per component for things that can come from other sources\n const apiReferenceDataFromPageProps = apiReferenceData2;\n\n const apiReferenceDataWithMdxAndDocsConfig = addApiReferenceDataFromMdxAndDocsConfig({\n apiReferenceData2: apiReferenceDataFromPageProps,\n mdxExtracts,\n docsConfig,\n pageMetadata,\n });\n\n // after we have the apiReferenceDataWithMdxAndDocsConfig, we can process the security options - some may have come from docs config\n const processedSecurityOptions = processSecurityOptions(apiReferenceDataWithMdxAndDocsConfig);\n if (processedSecurityOptions.length > 0) {\n if (!apiReferenceDataWithMdxAndDocsConfig.dependencies) {\n apiReferenceDataWithMdxAndDocsConfig.dependencies = {\n servers: {},\n security: {},\n processedSecurityOptions: [],\n };\n }\n apiReferenceDataWithMdxAndDocsConfig.dependencies.processedSecurityOptions =\n processedSecurityOptions;\n }\n\n const filteredApiReferenceData = apiReferenceDataWithMdxAndDocsConfig;\n return (\n <ApiReferenceContext2.Provider value={{ apiReferenceData2: filteredApiReferenceData ?? {} }}>\n {children}\n </ApiReferenceContext2.Provider>\n );\n}\n"],"names":["PageContext","createContext","DeploymentMetadataContext","DocsConfigContext","ApiReferenceContext","ApiReferenceContext2","PageProvider","value","children","jsx","DeploymentMetadataProvider","DocsConfigProvider","ApiReferenceProvider","ApiReferenceProvider2","pageMetadata","docsConfig","mdxExtracts","apiReferenceData2","apiReferenceDataWithMdxAndDocsConfig","addApiReferenceDataFromMdxAndDocsConfig","processedSecurityOptions","processSecurityOptions","filteredApiReferenceData"],"mappings":";;;;AAmEO,MAAMA,IAAcC,EAA+B,EAAE,cAAc,IAAI,GAEjEC,IAA4BD,EAA6C,CAAA,CAAE,GAE3EE,IAAoBF,EAAqC,CAAA,CAAE,GAE3DG,IAAsBH,EAAuC,EAAE,kBAAkB,IAAI,GAErFI,IAAuBJ,EAAwC;AAAA,EAC1E,mBAAmB,CAAA;AACrB,CAAC;AAEDD,EAAY,cAAc;AAC1BE,EAA0B,cAAc;AACxCC,EAAkB,cAAc;AAChCC,EAAoB,cAAc;AAE3B,SAASE,EAAa,EAAE,OAAAC,GAAO,UAAAC,KAA6D;AACjG,SAAO,gBAAAC,EAACT,EAAY,UAAZ,EAAqB,OAAAO,GAAe,UAAAC,EAAA,CAAS;AACvD;AAEO,SAASE,EAA2B;AAAA,EACzC,OAAAH;AAAA,EACA,UAAAC;AACF,GAGG;AACD,SACE,gBAAAC,EAACP,EAA0B,UAA1B,EAAmC,OAAAK,GACjC,UAAAC,EAAA,CACH;AAEJ;AAEO,SAASG,EAAmB;AAAA,EACjC,OAAAJ;AAAA,EACA,UAAAC;AACF,GAGG;AACD,SAAO,gBAAAC,EAACN,EAAkB,UAAlB,EAA2B,OAAAI,GAAe,UAAAC,EAAA,CAAS;AAC7D;AAEO,SAASI,EAAqB;AAAA,EACnC,OAAAL;AAAA,EACA,UAAAC;AACF,GAGG;AACD,SAAO,gBAAAC,EAACL,EAAoB,UAApB,EAA6B,OAAAG,GAAe,UAAAC,EAAA,CAAS;AAC/D;AAEO,SAASK,EAAsB;AAAA,EACpC,cAAAC;AAAA,EACA,YAAAC;AAAA,EACA,aAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,UAAAT;AACF,GAA+B;AAK7B,QAAMU,IAAuCC,EAAwC;AAAA,IACnF,mBAHoCF;AAAA,IAIpC,aAAAD;AAAA,IACA,YAAAD;AAAA,IACA,cAAAD;AAAA,EAAA,CACD,GAGKM,IAA2BC,EAAuBH,CAAoC;AAC5F,EAAIE,EAAyB,SAAS,MAC/BF,EAAqC,iBACxCA,EAAqC,eAAe;AAAA,IAClD,SAAS,CAAA;AAAA,IACT,UAAU,CAAA;AAAA,IACV,0BAA0B,CAAA;AAAA,EAAC,IAG/BA,EAAqC,aAAa,2BAChDE;AAGJ,QAAME,IAA2BJ;AACjC,SACE,gBAAAT,EAACJ,EAAqB,UAArB,EAA8B,OAAO,EAAE,mBAAmBiB,KAA4B,CAAA,KACpF,UAAAd,GACH;AAEJ;"}
1
+ {"version":3,"file":"ConfigContext.js","sources":["../../src/contexts/ConfigContext.tsx"],"sourcesContent":["\nimport type { MdxExtracts } from '@mintlify/common';\nimport { SerializeSuccess } from '@mintlify/mdx/types';\nimport { InkeepType, MintConfig, PageMetaTags } from '@mintlify/models';\nimport { PageType } from '@mintlify/models';\nimport {\n DeploymentEntitlements,\n GitSource,\n DeploymentFeedbackType,\n DocsConfig,\n DecoratedNavigationConfig,\n TrieveType,\n DeploymentPreviewType,\n} from '@mintlify/validation';\nimport { createContext, ReactNode } from 'react';\n\nimport { addApiReferenceDataFromMdxAndDocsConfig } from '@/api-playground-2/schemaGraph/addApiReferenceDataFromMdxAndDocsConfig';\nimport { processSecurityOptions } from '@/api-playground-2/schemaGraph/processSecurityOptions';\nimport type { ApiReferenceDataV2 } from '@/api-playground-2/types';\nimport { ApiReferenceData } from '../utils/api-reference/getApiReferenceData';\n\nexport type PageContextType = {\n pageMetadata: PageMetaTags;\n pageType?: PageType;\n mdxExtracts?: MdxExtracts;\n description?: SerializeSuccess | string | null;\n panelMdxSource?: SerializeSuccess;\n panelMdxSourceWithNoJs?: SerializeSuccess;\n pathname?: string;\n};\n\nexport type DeploymentMetadataContextType = {\n subdomain?: string;\n actualSubdomain?: string;\n gitSource?: GitSource;\n inkeep?: InkeepType;\n trieve?: TrieveType;\n feedback?: DeploymentFeedbackType;\n entitlements?: DeploymentEntitlements;\n buildId?: string;\n clientVersion?: string;\n preview?: DeploymentPreviewType;\n};\n\nexport type DocsConfigContextType = {\n mintConfig?: MintConfig;\n docsConfig?: DocsConfig;\n docsNavWithMetadata?: DecoratedNavigationConfig;\n};\n\nexport type ApiReferenceContextType = {\n apiReferenceData: ApiReferenceData;\n};\n\nexport type ApiReferenceContext2Type = {\n apiReferenceData2: ApiReferenceDataV2;\n};\n\nexport type ApiReferenceProvider2Props = {\n pageMetadata: PageMetaTags;\n docsConfig: DocsConfig | undefined;\n mdxExtracts: MdxExtracts | undefined;\n apiReferenceData2: ApiReferenceDataV2 | undefined;\n children: ReactNode;\n};\n\nexport const PageContext = createContext<PageContextType>({ pageMetadata: {} });\n\nexport const DeploymentMetadataContext = createContext<DeploymentMetadataContextType>({});\n\nexport const DocsConfigContext = createContext<DocsConfigContextType>({});\n\nexport const ApiReferenceContext = createContext<ApiReferenceContextType>({ apiReferenceData: {} });\n\nexport const ApiReferenceContext2 = createContext<ApiReferenceContext2Type>({\n apiReferenceData2: {},\n});\n\nPageContext.displayName = 'PageContext';\nDeploymentMetadataContext.displayName = 'DeploymentMetadataContext';\nDocsConfigContext.displayName = 'DocsConfigContext';\nApiReferenceContext.displayName = 'ApiReferenceContext';\n\nexport function PageProvider({ value, children }: { value: PageContextType; children: ReactNode }) {\n return <PageContext.Provider value={value}>{children}</PageContext.Provider>;\n}\n\nexport function DeploymentMetadataProvider({\n value,\n children,\n}: {\n value: DeploymentMetadataContextType;\n children: ReactNode;\n}) {\n return (\n <DeploymentMetadataContext.Provider value={value}>\n {children}\n </DeploymentMetadataContext.Provider>\n );\n}\n\nexport function DocsConfigProvider({\n value,\n children,\n}: {\n value: DocsConfigContextType;\n children: ReactNode;\n}) {\n return <DocsConfigContext.Provider value={value}>{children}</DocsConfigContext.Provider>;\n}\n\nexport function ApiReferenceProvider({\n value,\n children,\n}: {\n value: ApiReferenceContextType;\n children: ReactNode;\n}) {\n return <ApiReferenceContext.Provider value={value}>{children}</ApiReferenceContext.Provider>;\n}\n\nexport function ApiReferenceProvider2({\n pageMetadata,\n docsConfig,\n mdxExtracts,\n apiReferenceData2,\n children,\n}: ApiReferenceProvider2Props) {\n // combine apiReferenceData2 from page props with mdxExtracts and docsConfig so we don't\n // have to go hunting per component for things that can come from other sources\n const apiReferenceDataFromPageProps = apiReferenceData2;\n\n const apiReferenceDataWithMdxAndDocsConfig = addApiReferenceDataFromMdxAndDocsConfig({\n apiReferenceData2: apiReferenceDataFromPageProps,\n mdxExtracts,\n docsConfig,\n pageMetadata,\n });\n\n // after we have the apiReferenceDataWithMdxAndDocsConfig, we can process the security options - some may have come from docs config\n const processedSecurityOptions = processSecurityOptions(apiReferenceDataWithMdxAndDocsConfig);\n if (processedSecurityOptions.length > 0) {\n if (!apiReferenceDataWithMdxAndDocsConfig.dependencies) {\n apiReferenceDataWithMdxAndDocsConfig.dependencies = {\n servers: {},\n security: {},\n processedSecurityOptions: [],\n };\n }\n apiReferenceDataWithMdxAndDocsConfig.dependencies.processedSecurityOptions =\n processedSecurityOptions;\n }\n\n const filteredApiReferenceData = apiReferenceDataWithMdxAndDocsConfig;\n return (\n <ApiReferenceContext2.Provider value={{ apiReferenceData2: filteredApiReferenceData ?? {} }}>\n {children}\n </ApiReferenceContext2.Provider>\n );\n}\n"],"names":["PageContext","createContext","DeploymentMetadataContext","DocsConfigContext","ApiReferenceContext","ApiReferenceContext2","PageProvider","value","children","jsx","DeploymentMetadataProvider","DocsConfigProvider","ApiReferenceProvider","ApiReferenceProvider2","pageMetadata","docsConfig","mdxExtracts","apiReferenceData2","apiReferenceDataWithMdxAndDocsConfig","addApiReferenceDataFromMdxAndDocsConfig","processedSecurityOptions","processSecurityOptions","filteredApiReferenceData"],"mappings":";;;;AAkEO,MAAMA,IAAcC,EAA+B,EAAE,cAAc,IAAI,GAEjEC,IAA4BD,EAA6C,CAAA,CAAE,GAE3EE,IAAoBF,EAAqC,CAAA,CAAE,GAE3DG,IAAsBH,EAAuC,EAAE,kBAAkB,IAAI,GAErFI,IAAuBJ,EAAwC;AAAA,EAC1E,mBAAmB,CAAA;AACrB,CAAC;AAEDD,EAAY,cAAc;AAC1BE,EAA0B,cAAc;AACxCC,EAAkB,cAAc;AAChCC,EAAoB,cAAc;AAE3B,SAASE,EAAa,EAAE,OAAAC,GAAO,UAAAC,KAA6D;AACjG,SAAO,gBAAAC,EAACT,EAAY,UAAZ,EAAqB,OAAAO,GAAe,UAAAC,EAAA,CAAS;AACvD;AAEO,SAASE,EAA2B;AAAA,EACzC,OAAAH;AAAA,EACA,UAAAC;AACF,GAGG;AACD,SACE,gBAAAC,EAACP,EAA0B,UAA1B,EAAmC,OAAAK,GACjC,UAAAC,EAAA,CACH;AAEJ;AAEO,SAASG,EAAmB;AAAA,EACjC,OAAAJ;AAAA,EACA,UAAAC;AACF,GAGG;AACD,SAAO,gBAAAC,EAACN,EAAkB,UAAlB,EAA2B,OAAAI,GAAe,UAAAC,EAAA,CAAS;AAC7D;AAEO,SAASI,EAAqB;AAAA,EACnC,OAAAL;AAAA,EACA,UAAAC;AACF,GAGG;AACD,SAAO,gBAAAC,EAACL,EAAoB,UAApB,EAA6B,OAAAG,GAAe,UAAAC,EAAA,CAAS;AAC/D;AAEO,SAASK,EAAsB;AAAA,EACpC,cAAAC;AAAA,EACA,YAAAC;AAAA,EACA,aAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,UAAAT;AACF,GAA+B;AAK7B,QAAMU,IAAuCC,EAAwC;AAAA,IACnF,mBAHoCF;AAAA,IAIpC,aAAAD;AAAA,IACA,YAAAD;AAAA,IACA,cAAAD;AAAA,EAAA,CACD,GAGKM,IAA2BC,EAAuBH,CAAoC;AAC5F,EAAIE,EAAyB,SAAS,MAC/BF,EAAqC,iBACxCA,EAAqC,eAAe;AAAA,IAClD,SAAS,CAAA;AAAA,IACT,UAAU,CAAA;AAAA,IACV,0BAA0B,CAAA;AAAA,EAAC,IAG/BA,EAAqC,aAAa,2BAChDE;AAGJ,QAAME,IAA2BJ;AACjC,SACE,gBAAAT,EAACJ,EAAqB,UAArB,EAA8B,OAAO,EAAE,mBAAmBiB,KAA4B,CAAA,KACpF,UAAAd,GACH;AAEJ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"EndpointLocationContext.js","sources":["../../src/contexts/EndpointLocationContext.tsx"],"sourcesContent":["'use client';\n\nimport { createContext, ReactElement, MutableRefObject, useContext, useRef } from 'react';\n\nimport { useCheckHash } from '../hooks/useCheckHash';\nimport { LocationType } from '../api-playground-2/types/api';\n\nexport type EndpointLocationContextType = {\n location?: LocationType;\n anchor?: string;\n hasScrolledToAnchorRef?: MutableRefObject<boolean>;\n};\n\nexport const EndpointLocationContext = createContext<EndpointLocationContextType>({});\n\nexport const useEndpointLocation = () => useContext(EndpointLocationContext);\n\nexport function EndpointLocationProvider({\n location,\n children,\n}: {\n location?: LocationType;\n children?: ReactElement;\n}) {\n const hasScrolledToAnchorRef = useRef(false);\n const anchor = useCheckHash();\n return (\n <EndpointLocationContext.Provider value={{ location, anchor, hasScrolledToAnchorRef }}>\n {children}\n </EndpointLocationContext.Provider>\n );\n}\n\nEndpointLocationContext.displayName = 'EndpointLocationContext';\n"],"names":["EndpointLocationContext","createContext","useEndpointLocation","useContext","EndpointLocationProvider","location","children","hasScrolledToAnchorRef","useRef","anchor","useCheckHash","jsx"],"mappings":";;;AAaO,MAAMA,IAA0BC,EAA2C,CAAA,CAAE,GAEvEC,IAAsB,MAAMC,EAAWH,CAAuB;AAEpE,SAASI,EAAyB;AAAA,EACvC,UAAAC;AAAA,EACA,UAAAC;AACF,GAGG;AACD,QAAMC,IAAyBC,EAAO,EAAK,GACrCC,IAASC,EAAA;AACf,SACE,gBAAAC,EAACX,EAAwB,UAAxB,EAAiC,OAAO,EAAE,UAAAK,GAAU,QAAAI,GAAQ,wBAAAF,KAC1D,UAAAD,GACH;AAEJ;AAEAN,EAAwB,cAAc;"}
1
+ {"version":3,"file":"EndpointLocationContext.js","sources":["../../src/contexts/EndpointLocationContext.tsx"],"sourcesContent":["\nimport { createContext, ReactElement, MutableRefObject, useContext, useRef } from 'react';\n\nimport { useCheckHash } from '../hooks/useCheckHash';\nimport { LocationType } from '../api-playground-2/types/api';\n\nexport type EndpointLocationContextType = {\n location?: LocationType;\n anchor?: string;\n hasScrolledToAnchorRef?: MutableRefObject<boolean>;\n};\n\nexport const EndpointLocationContext = createContext<EndpointLocationContextType>({});\n\nexport const useEndpointLocation = () => useContext(EndpointLocationContext);\n\nexport function EndpointLocationProvider({\n location,\n children,\n}: {\n location?: LocationType;\n children?: ReactElement;\n}) {\n const hasScrolledToAnchorRef = useRef(false);\n const anchor = useCheckHash();\n return (\n <EndpointLocationContext.Provider value={{ location, anchor, hasScrolledToAnchorRef }}>\n {children}\n </EndpointLocationContext.Provider>\n );\n}\n\nEndpointLocationContext.displayName = 'EndpointLocationContext';\n"],"names":["EndpointLocationContext","createContext","useEndpointLocation","useContext","EndpointLocationProvider","location","children","hasScrolledToAnchorRef","useRef","anchor","useCheckHash","jsx"],"mappings":";;;AAYO,MAAMA,IAA0BC,EAA2C,CAAA,CAAE,GAEvEC,IAAsB,MAAMC,EAAWH,CAAuB;AAEpE,SAASI,EAAyB;AAAA,EACvC,UAAAC;AAAA,EACA,UAAAC;AACF,GAGG;AACD,QAAMC,IAAyBC,EAAO,EAAK,GACrCC,IAASC,EAAA;AACf,SACE,gBAAAC,EAACX,EAAwB,UAAxB,EAAiC,OAAO,EAAE,UAAAK,GAAU,QAAAI,GAAQ,wBAAAF,KAC1D,UAAAD,GACH;AAEJ;AAEAN,EAAwB,cAAc;"}
@@ -1 +1 @@
1
- {"version":3,"file":"MDXContentContext.js","sources":["../../src/contexts/MDXContentContext.tsx"],"sourcesContent":["'use client';\n\nimport { createContext, ReactNode, Reducer, useContext, useMemo, useReducer } from 'react';\n\nimport { ChangelogFilterType, HeadingType, MDXContentState } from '../types/mdxContentController';\n\nimport { PageContext } from './ConfigContext';\n\nexport const initialState: MDXContentState = {\n headings: [],\n apiBaseIndex: 0,\n codeExamples: {},\n pageMetadata: {},\n selectedBodyContentType: undefined,\n selectedResponseContentType: undefined,\n tableOfContents: [],\n changelogFilters: [],\n};\n\n/**\n * Actions that can be dispatched in the MDXContentReducer.\n */\ntype MDXContentAction =\n | { type: 'set_state'; payload: Partial<MDXContentState> }\n | { type: 'set_api_base_index'; payload: number }\n | { type: 'set_selected_body_content_type'; payload: string }\n | { type: 'set_selected_response_content_type'; payload: string }\n | { type: 'register_heading'; payload: HeadingType }\n | { type: 'unregister_heading'; payload: string }\n | { type: 'toggle_changelog_filter'; payload: ChangelogFilterType };\n\nexport type MDXContentActionType = MDXContentAction['type'];\n\n/**\n * Consolidates state and update logic of MDXContentController.\n * @param state - current state.\n * @param action - state action to dispatch.\n * @returns MDXContentState - new state.\n */\nexport const MDXContentReducer: Reducer<MDXContentState, MDXContentAction> = (\n state: MDXContentState,\n action\n) => {\n const type = action.type;\n switch (type) {\n case 'set_state':\n return {\n ...state,\n ...action.payload,\n };\n case 'register_heading':\n const { id, top } = action.payload;\n return {\n ...state,\n headings: [...state.headings.filter((h) => id !== h.id), { id, top }],\n };\n case 'unregister_heading':\n return {\n ...state,\n headings: state.headings.filter((h) => action.payload !== h.id),\n };\n case 'set_selected_body_content_type':\n return {\n ...state,\n selectedBodyContentType: action.payload,\n };\n case 'set_selected_response_content_type':\n return {\n ...state,\n selectedResponseContentType: action.payload,\n };\n case 'set_api_base_index':\n return {\n ...state,\n apiBaseIndex: action.payload,\n };\n case 'toggle_changelog_filter':\n const existingFilterIndex = state.changelogFilters.findIndex(\n (filter) => filter.tag === action.payload.tag\n );\n if (existingFilterIndex !== -1) {\n const newFilters = [...state.changelogFilters];\n newFilters[existingFilterIndex] = action.payload;\n return {\n ...state,\n changelogFilters: newFilters,\n };\n }\n return {\n ...state,\n changelogFilters: [...state.changelogFilters, action.payload],\n };\n }\n};\n\nexport const useMDXContentReducer = (state?: Partial<MDXContentState>) => {\n const initializedState = {\n ...initialState,\n ...state,\n };\n return useReducer(MDXContentReducer, initializedState);\n};\n\nexport function useInitializeMDXContentReducer() {\n const { pageMetadata, mdxExtracts } = useContext(PageContext);\n const initialSelectedBodyContentType = Object.keys(mdxExtracts?.endpoint?.request.body ?? {})[0];\n\n const ctx = useMDXContentReducer({\n pageMetadata,\n selectedBodyContentType: initialSelectedBodyContentType,\n ...mdxExtracts,\n });\n\n return useMemo(() => {\n return ctx;\n }, [ctx]);\n}\n\nexport type MDXContentContextType = ReturnType<typeof useMDXContentReducer>;\n\nexport const MDXContentContext = createContext<MDXContentContextType>([initialState, () => null]);\n\nexport function MDXContentProvider({ children }: { children: ReactNode }) {\n const ctx = useInitializeMDXContentReducer();\n return <MDXContentContext.Provider value={ctx}>{children}</MDXContentContext.Provider>;\n}\n\nMDXContentContext.displayName = 'MDXContentContext';\n"],"names":["initialState","MDXContentContext","createContext"],"mappings":";;AAQO,MAAMA,IAAgC;AAAA,EAC3C,UAAU,CAAA;AAAA,EACV,cAAc;AAAA,EACd,cAAc,CAAA;AAAA,EACd,cAAc,CAAA;AAAA,EACd,yBAAyB;AAAA,EACzB,6BAA6B;AAAA,EAC7B,iBAAiB,CAAA;AAAA,EACjB,kBAAkB,CAAA;AACpB,GAuGaC,IAAoBC,EAAqC,CAACF,GAAc,MAAM,IAAI,CAAC;AAOhGC,EAAkB,cAAc;"}
1
+ {"version":3,"file":"MDXContentContext.js","sources":["../../src/contexts/MDXContentContext.tsx"],"sourcesContent":["\nimport { createContext, ReactNode, Reducer, useContext, useMemo, useReducer } from 'react';\n\nimport { ChangelogFilterType, HeadingType, MDXContentState } from '../types/mdxContentController';\n\nimport { PageContext } from './ConfigContext';\n\nexport const initialState: MDXContentState = {\n headings: [],\n apiBaseIndex: 0,\n codeExamples: {},\n pageMetadata: {},\n selectedBodyContentType: undefined,\n selectedResponseContentType: undefined,\n tableOfContents: [],\n changelogFilters: [],\n};\n\n/**\n * Actions that can be dispatched in the MDXContentReducer.\n */\ntype MDXContentAction =\n | { type: 'set_state'; payload: Partial<MDXContentState> }\n | { type: 'set_api_base_index'; payload: number }\n | { type: 'set_selected_body_content_type'; payload: string }\n | { type: 'set_selected_response_content_type'; payload: string }\n | { type: 'register_heading'; payload: HeadingType }\n | { type: 'unregister_heading'; payload: string }\n | { type: 'toggle_changelog_filter'; payload: ChangelogFilterType };\n\nexport type MDXContentActionType = MDXContentAction['type'];\n\n/**\n * Consolidates state and update logic of MDXContentController.\n * @param state - current state.\n * @param action - state action to dispatch.\n * @returns MDXContentState - new state.\n */\nexport const MDXContentReducer: Reducer<MDXContentState, MDXContentAction> = (\n state: MDXContentState,\n action\n) => {\n const type = action.type;\n switch (type) {\n case 'set_state':\n return {\n ...state,\n ...action.payload,\n };\n case 'register_heading':\n const { id, top } = action.payload;\n return {\n ...state,\n headings: [...state.headings.filter((h) => id !== h.id), { id, top }],\n };\n case 'unregister_heading':\n return {\n ...state,\n headings: state.headings.filter((h) => action.payload !== h.id),\n };\n case 'set_selected_body_content_type':\n return {\n ...state,\n selectedBodyContentType: action.payload,\n };\n case 'set_selected_response_content_type':\n return {\n ...state,\n selectedResponseContentType: action.payload,\n };\n case 'set_api_base_index':\n return {\n ...state,\n apiBaseIndex: action.payload,\n };\n case 'toggle_changelog_filter':\n const existingFilterIndex = state.changelogFilters.findIndex(\n (filter) => filter.tag === action.payload.tag\n );\n if (existingFilterIndex !== -1) {\n const newFilters = [...state.changelogFilters];\n newFilters[existingFilterIndex] = action.payload;\n return {\n ...state,\n changelogFilters: newFilters,\n };\n }\n return {\n ...state,\n changelogFilters: [...state.changelogFilters, action.payload],\n };\n }\n};\n\nexport const useMDXContentReducer = (state?: Partial<MDXContentState>) => {\n const initializedState = {\n ...initialState,\n ...state,\n };\n return useReducer(MDXContentReducer, initializedState);\n};\n\nexport function useInitializeMDXContentReducer() {\n const { pageMetadata, mdxExtracts } = useContext(PageContext);\n const initialSelectedBodyContentType = Object.keys(mdxExtracts?.endpoint?.request.body ?? {})[0];\n\n const ctx = useMDXContentReducer({\n pageMetadata,\n selectedBodyContentType: initialSelectedBodyContentType,\n ...mdxExtracts,\n });\n\n return useMemo(() => {\n return ctx;\n }, [ctx]);\n}\n\nexport type MDXContentContextType = ReturnType<typeof useMDXContentReducer>;\n\nexport const MDXContentContext = createContext<MDXContentContextType>([initialState, () => null]);\n\nexport function MDXContentProvider({ children }: { children: ReactNode }) {\n const ctx = useInitializeMDXContentReducer();\n return <MDXContentContext.Provider value={ctx}>{children}</MDXContentContext.Provider>;\n}\n\nMDXContentContext.displayName = 'MDXContentContext';\n"],"names":["initialState","MDXContentContext","createContext"],"mappings":";;AAOO,MAAMA,IAAgC;AAAA,EAC3C,UAAU,CAAA;AAAA,EACV,cAAc;AAAA,EACd,cAAc,CAAA;AAAA,EACd,cAAc,CAAA;AAAA,EACd,yBAAyB;AAAA,EACzB,6BAA6B;AAAA,EAC7B,iBAAiB,CAAA;AAAA,EACjB,kBAAkB,CAAA;AACpB,GAuGaC,IAAoBC,EAAqC,CAACF,GAAc,MAAM,IAAI,CAAC;AAOhGC,EAAkB,cAAc;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useApiPlaygroundDisplay.js","sources":["../../src/hooks/useApiPlaygroundDisplay.ts"],"sourcesContent":["'use client';\n\nimport { ApiPlaygroundDisplayType } from '@mintlify/models';\nimport { EndpointType } from '@mintlify/validation';\nimport { useContext, useMemo } from 'react';\n\nimport { ApiReferenceContext2, DocsConfigContext, PageContext } from '../contexts/ConfigContext';\nimport { useEndpoint } from '../hooks/useEndpoint';\n\nexport const useApiPlaygroundDisplay = (): ApiPlaygroundDisplayType => {\n const { docsConfig } = useContext(DocsConfigContext);\n const { pageMetadata } = useContext(PageContext);\n const endpoint = useEndpoint();\n const { apiReferenceData2 } = useContext(ApiReferenceContext2);\n\n let endpointType: EndpointType | undefined;\n if (apiReferenceData2.operation) {\n endpointType = apiReferenceData2.operation.type;\n } else {\n endpointType = endpoint?.type;\n }\n\n return useMemo(() => {\n const mode =\n endpointType === 'webhook'\n ? 'simple'\n : pageMetadata.playground || docsConfig?.api?.playground?.display;\n return mode ?? 'interactive';\n }, [docsConfig, pageMetadata, endpointType]);\n};\n"],"names":["useApiPlaygroundDisplay","docsConfig","useContext","DocsConfigContext","pageMetadata","PageContext","endpoint","useEndpoint","apiReferenceData2","ApiReferenceContext2","endpointType","useMemo","_b","_a"],"mappings":";;;AASO,MAAMA,IAA0B,MAAgC;AACrE,QAAM,EAAE,YAAAC,EAAA,IAAeC,EAAWC,CAAiB,GAC7C,EAAE,cAAAC,EAAA,IAAiBF,EAAWG,CAAW,GACzCC,IAAWC,EAAA,GACX,EAAE,mBAAAC,EAAA,IAAsBN,EAAWO,CAAoB;AAE7D,MAAIC;AACJ,SAAIF,EAAkB,YACpBE,IAAeF,EAAkB,UAAU,OAE3CE,IAAeJ,KAAA,gBAAAA,EAAU,MAGpBK,EAAQ,MAAM;;AAKnB,YAHED,MAAiB,YACb,WACAN,EAAa,gBAAcQ,KAAAC,IAAAZ,KAAA,gBAAAA,EAAY,QAAZ,gBAAAY,EAAiB,eAAjB,gBAAAD,EAA6B,aAC/C;AAAA,EACjB,GAAG,CAACX,GAAYG,GAAcM,CAAY,CAAC;AAC7C;"}
1
+ {"version":3,"file":"useApiPlaygroundDisplay.js","sources":["../../src/hooks/useApiPlaygroundDisplay.ts"],"sourcesContent":["\nimport { ApiPlaygroundDisplayType } from '@mintlify/models';\nimport { EndpointType } from '@mintlify/validation';\nimport { useContext, useMemo } from 'react';\n\nimport { ApiReferenceContext2, DocsConfigContext, PageContext } from '../contexts/ConfigContext';\nimport { useEndpoint } from '../hooks/useEndpoint';\n\nexport const useApiPlaygroundDisplay = (): ApiPlaygroundDisplayType => {\n const { docsConfig } = useContext(DocsConfigContext);\n const { pageMetadata } = useContext(PageContext);\n const endpoint = useEndpoint();\n const { apiReferenceData2 } = useContext(ApiReferenceContext2);\n\n let endpointType: EndpointType | undefined;\n if (apiReferenceData2.operation) {\n endpointType = apiReferenceData2.operation.type;\n } else {\n endpointType = endpoint?.type;\n }\n\n return useMemo(() => {\n const mode =\n endpointType === 'webhook'\n ? 'simple'\n : pageMetadata.playground || docsConfig?.api?.playground?.display;\n return mode ?? 'interactive';\n }, [docsConfig, pageMetadata, endpointType]);\n};\n"],"names":["useApiPlaygroundDisplay","docsConfig","useContext","DocsConfigContext","pageMetadata","PageContext","endpoint","useEndpoint","apiReferenceData2","ApiReferenceContext2","endpointType","useMemo","_b","_a"],"mappings":";;;AAQO,MAAMA,IAA0B,MAAgC;AACrE,QAAM,EAAE,YAAAC,EAAA,IAAeC,EAAWC,CAAiB,GAC7C,EAAE,cAAAC,EAAA,IAAiBF,EAAWG,CAAW,GACzCC,IAAWC,EAAA,GACX,EAAE,mBAAAC,EAAA,IAAsBN,EAAWO,CAAoB;AAE7D,MAAIC;AACJ,SAAIF,EAAkB,YACpBE,IAAeF,EAAkB,UAAU,OAE3CE,IAAeJ,KAAA,gBAAAA,EAAU,MAGpBK,EAAQ,MAAM;;AAKnB,YAHED,MAAiB,YACb,WACAN,EAAa,gBAAcQ,KAAAC,IAAAZ,KAAA,gBAAAA,EAAY,QAAZ,gBAAAY,EAAiB,eAAjB,gBAAAD,EAA6B,aAC/C;AAAA,EACjB,GAAG,CAACX,GAAYG,GAAcM,CAAY,CAAC;AAC7C;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useApiPlaygroundInputs.js","sources":["../../src/hooks/useApiPlaygroundInputs.ts"],"sourcesContent":["'use client';\n\nimport { useContext } from 'react';\n\nimport { ApiPlaygroundInputsContext } from '@/contexts/ApiPlaygroundInputsContext';\n\nexport const useApiPlaygroundInputs = () => useContext(ApiPlaygroundInputsContext);\n"],"names":["useApiPlaygroundInputs","useContext","ApiPlaygroundInputsContext"],"mappings":";;AAMO,MAAMA,IAAyB,MAAMC,EAAWC,CAA0B;"}
1
+ {"version":3,"file":"useApiPlaygroundInputs.js","sources":["../../src/hooks/useApiPlaygroundInputs.ts"],"sourcesContent":["\nimport { useContext } from 'react';\n\nimport { ApiPlaygroundInputsContext } from '@/contexts/ApiPlaygroundInputsContext';\n\nexport const useApiPlaygroundInputs = () => useContext(ApiPlaygroundInputsContext);\n"],"names":["useApiPlaygroundInputs","useContext","ApiPlaygroundInputsContext"],"mappings":";;AAKO,MAAMA,IAAyB,MAAMC,EAAWC,CAA0B;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useBaseUrlOptions.js","sources":["../../src/hooks/useBaseUrlOptions.ts"],"sourcesContent":["'use client';\n\nimport { useContext, useMemo } from 'react';\n\nimport { DocsConfigContext } from '../contexts/ConfigContext';\n\nimport { useEndpoint } from '../hooks/useEndpoint';\n\nexport const useBaseUrlOptions = () => {\n const endpoint = useEndpoint();\n const { docsConfig } = useContext(DocsConfigContext);\n\n return useMemo(() => {\n const endpointUrls = endpoint?.servers?.map(({ url }) => url);\n if (endpointUrls && endpointUrls.length > 0) {\n return endpointUrls;\n }\n\n const configUrlOrUrls = docsConfig?.api?.mdx?.server;\n return typeof configUrlOrUrls === 'string' ? [configUrlOrUrls] : configUrlOrUrls;\n }, [endpoint?.servers, docsConfig?.api?.mdx?.server]);\n};\n"],"names":["useBaseUrlOptions","endpoint","useEndpoint","docsConfig","useContext","DocsConfigContext","useMemo","endpointUrls","_a","url","configUrlOrUrls","_c","_b"],"mappings":";;;AAQO,MAAMA,IAAoB,MAAM;;AACrC,QAAMC,IAAWC,EAAA,GACX,EAAE,YAAAC,EAAA,IAAeC,EAAWC,CAAiB;AAEnD,SAAOC,EAAQ,MAAM;;AACnB,UAAMC,KAAeC,IAAAP,KAAA,gBAAAA,EAAU,YAAV,gBAAAO,EAAmB,IAAI,CAAC,EAAE,KAAAC,EAAA,MAAUA;AACzD,QAAIF,KAAgBA,EAAa,SAAS;AACxC,aAAOA;AAGT,UAAMG,KAAkBC,KAAAC,IAAAT,KAAA,gBAAAA,EAAY,QAAZ,gBAAAS,EAAiB,QAAjB,gBAAAD,EAAsB;AAC9C,WAAO,OAAOD,KAAoB,WAAW,CAACA,CAAe,IAAIA;AAAA,EACnE,GAAG,CAACT,KAAA,gBAAAA,EAAU,UAASW,KAAAJ,IAAAL,KAAA,gBAAAA,EAAY,QAAZ,gBAAAK,EAAiB,QAAjB,gBAAAI,EAAsB,MAAM,CAAC;AACtD;"}
1
+ {"version":3,"file":"useBaseUrlOptions.js","sources":["../../src/hooks/useBaseUrlOptions.ts"],"sourcesContent":["\nimport { useContext, useMemo } from 'react';\n\nimport { DocsConfigContext } from '../contexts/ConfigContext';\n\nimport { useEndpoint } from '../hooks/useEndpoint';\n\nexport const useBaseUrlOptions = () => {\n const endpoint = useEndpoint();\n const { docsConfig } = useContext(DocsConfigContext);\n\n return useMemo(() => {\n const endpointUrls = endpoint?.servers?.map(({ url }) => url);\n if (endpointUrls && endpointUrls.length > 0) {\n return endpointUrls;\n }\n\n const configUrlOrUrls = docsConfig?.api?.mdx?.server;\n return typeof configUrlOrUrls === 'string' ? [configUrlOrUrls] : configUrlOrUrls;\n }, [endpoint?.servers, docsConfig?.api?.mdx?.server]);\n};\n"],"names":["useBaseUrlOptions","endpoint","useEndpoint","docsConfig","useContext","DocsConfigContext","useMemo","endpointUrls","_a","url","configUrlOrUrls","_c","_b"],"mappings":";;;AAOO,MAAMA,IAAoB,MAAM;;AACrC,QAAMC,IAAWC,EAAA,GACX,EAAE,YAAAC,EAAA,IAAeC,EAAWC,CAAiB;AAEnD,SAAOC,EAAQ,MAAM;;AACnB,UAAMC,KAAeC,IAAAP,KAAA,gBAAAA,EAAU,YAAV,gBAAAO,EAAmB,IAAI,CAAC,EAAE,KAAAC,EAAA,MAAUA;AACzD,QAAIF,KAAgBA,EAAa,SAAS;AACxC,aAAOA;AAGT,UAAMG,KAAkBC,KAAAC,IAAAT,KAAA,gBAAAA,EAAY,QAAZ,gBAAAS,EAAiB,QAAjB,gBAAAD,EAAsB;AAC9C,WAAO,OAAOD,KAAoB,WAAW,CAACA,CAAe,IAAIA;AAAA,EACnE,GAAG,CAACT,KAAA,gBAAAA,EAAU,UAASW,KAAAJ,IAAAL,KAAA,gBAAAA,EAAY,QAAZ,gBAAAK,EAAiB,QAAjB,gBAAAI,EAAsB,MAAM,CAAC;AACtD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useEndpoint.js","sources":["../../src/hooks/useEndpoint.ts"],"sourcesContent":["'use client';\n\nimport { useContext, useMemo } from 'react';\n\nimport { ApiReferenceContext } from '../contexts/ConfigContext';\n\n// we sometimes only want the OpenAPI endpoint (e.g. Endpoint Fields)\nexport const useOpenApiEndpoint = () => {\n const {\n apiReferenceData: { endpoint },\n } = useContext(ApiReferenceContext);\n\n return endpoint;\n};\n\nexport const useHasOpenApiEndpoint = () => {\n const openApiEndpoint = useOpenApiEndpoint();\n\n return openApiEndpoint !== undefined;\n};\n\nexport const useEndpoint = () => {\n const openApiEndpoint = useOpenApiEndpoint();\n\n return useMemo(() => {\n // if both exist, prefer OpenAPI\n return openApiEndpoint;\n }, [openApiEndpoint]);\n};\n\nexport const useHasEndpoint = () => {\n const endpoint = useEndpoint();\n\n return endpoint !== undefined;\n};\n"],"names":["useOpenApiEndpoint","endpoint","useContext","ApiReferenceContext","useEndpoint","openApiEndpoint","useMemo"],"mappings":";;AAOO,MAAMA,IAAqB,MAAM;AACtC,QAAM;AAAA,IACJ,kBAAkB,EAAE,UAAAC,EAAA;AAAA,EAAS,IAC3BC,EAAWC,CAAmB;AAElC,SAAOF;AACT,GAQaG,IAAc,MAAM;AAC/B,QAAMC,IAAkBL,EAAA;AAExB,SAAOM,EAAQ,MAEND,GACN,CAACA,CAAe,CAAC;AACtB;"}
1
+ {"version":3,"file":"useEndpoint.js","sources":["../../src/hooks/useEndpoint.ts"],"sourcesContent":["\nimport { useContext, useMemo } from 'react';\n\nimport { ApiReferenceContext } from '../contexts/ConfigContext';\n\n// we sometimes only want the OpenAPI endpoint (e.g. Endpoint Fields)\nexport const useOpenApiEndpoint = () => {\n const {\n apiReferenceData: { endpoint },\n } = useContext(ApiReferenceContext);\n\n return endpoint;\n};\n\nexport const useHasOpenApiEndpoint = () => {\n const openApiEndpoint = useOpenApiEndpoint();\n\n return openApiEndpoint !== undefined;\n};\n\nexport const useEndpoint = () => {\n const openApiEndpoint = useOpenApiEndpoint();\n\n return useMemo(() => {\n // if both exist, prefer OpenAPI\n return openApiEndpoint;\n }, [openApiEndpoint]);\n};\n\nexport const useHasEndpoint = () => {\n const endpoint = useEndpoint();\n\n return endpoint !== undefined;\n};\n"],"names":["useOpenApiEndpoint","endpoint","useContext","ApiReferenceContext","useEndpoint","openApiEndpoint","useMemo"],"mappings":";;AAMO,MAAMA,IAAqB,MAAM;AACtC,QAAM;AAAA,IACJ,kBAAkB,EAAE,UAAAC,EAAA;AAAA,EAAS,IAC3BC,EAAWC,CAAmB;AAElC,SAAOF;AACT,GAQaG,IAAc,MAAM;AAC/B,QAAMC,IAAkBL,EAAA;AAExB,SAAOM,EAAQ,MAEND,GACN,CAACA,CAAe,CAAC;AACtB;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useKeyboardShortcut.js","sources":["../../src/hooks/useKeyboardShortcut.ts"],"sourcesContent":["'use client';\n\nimport { useCallback, useEffect } from 'react';\n\ntype UseKeyboardShortcutType = {\n key: string;\n callback: (() => void) | (() => Promise<void>) | undefined;\n isSingleKey?: boolean;\n excludedActiveElementId?: string[];\n excludedActiveElements?: (keyof HTMLElementTagNameMap)[];\n isDisabled?: boolean;\n};\n\nexport const useKeyboardShortcut = ({\n key,\n callback,\n isSingleKey,\n excludedActiveElementId,\n excludedActiveElements,\n isDisabled,\n}: UseKeyboardShortcutType) => {\n const onKeypress = useCallback(\n (event: KeyboardEvent) => {\n if (isDisabled) return;\n\n let shouldExclude = false;\n const activeElement = document.activeElement;\n\n if (excludedActiveElementId) {\n shouldExclude = !!activeElement?.id && excludedActiveElementId.includes(activeElement.id);\n }\n\n if (excludedActiveElements && !shouldExclude) {\n shouldExclude = excludedActiveElements.includes(\n \n activeElement?.tagName.toLowerCase() as keyof HTMLElementTagNameMap\n );\n }\n\n const isShortcut = event.key === key && (isSingleKey || event.metaKey || event.ctrlKey);\n if (isShortcut && !shouldExclude) {\n event.preventDefault();\n void callback?.();\n }\n },\n [callback, key, isSingleKey, excludedActiveElementId, excludedActiveElements, isDisabled]\n );\n\n useEffect(() => {\n addEventListener('keydown', onKeypress);\n return () => removeEventListener('keydown', onKeypress);\n }, [onKeypress]);\n};\n"],"names":["useKeyboardShortcut","key","callback","isSingleKey","excludedActiveElementId","excludedActiveElements","isDisabled","onKeypress","useCallback","event","shouldExclude","activeElement","useEffect"],"mappings":";AAaO,MAAMA,IAAsB,CAAC;AAAA,EAClC,KAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC;AAAA,EACA,yBAAAC;AAAA,EACA,wBAAAC;AAAA,EACA,YAAAC;AACF,MAA+B;AAC7B,QAAMC,IAAaC;AAAA,IACjB,CAACC,MAAyB;AACxB,UAAIH,EAAY;AAEhB,UAAII,IAAgB;AACpB,YAAMC,IAAgB,SAAS;AAE/B,MAAIP,MACFM,IAAgB,CAAC,EAACC,KAAA,QAAAA,EAAe,OAAMP,EAAwB,SAASO,EAAc,EAAE,IAGtFN,KAA0B,CAACK,MAC7BA,IAAgBL,EAAuB;AAAA,QAErCM,KAAA,gBAAAA,EAAe,QAAQ;AAAA,MAAY,IAIpBF,EAAM,QAAQR,MAAQE,KAAeM,EAAM,WAAWA,EAAM,YAC7D,CAACC,MACjBD,EAAM,eAAA,GACDP,KAAA,QAAAA;AAAA,IAET;AAAA,IACA,CAACA,GAAUD,GAAKE,GAAaC,GAAyBC,GAAwBC,CAAU;AAAA,EAAA;AAG1F,EAAAM,EAAU,OACR,iBAAiB,WAAWL,CAAU,GAC/B,MAAM,oBAAoB,WAAWA,CAAU,IACrD,CAACA,CAAU,CAAC;AACjB;"}
1
+ {"version":3,"file":"useKeyboardShortcut.js","sources":["../../src/hooks/useKeyboardShortcut.ts"],"sourcesContent":["\nimport { useCallback, useEffect } from 'react';\n\ntype UseKeyboardShortcutType = {\n key: string;\n callback: (() => void) | (() => Promise<void>) | undefined;\n isSingleKey?: boolean;\n excludedActiveElementId?: string[];\n excludedActiveElements?: (keyof HTMLElementTagNameMap)[];\n isDisabled?: boolean;\n};\n\nexport const useKeyboardShortcut = ({\n key,\n callback,\n isSingleKey,\n excludedActiveElementId,\n excludedActiveElements,\n isDisabled,\n}: UseKeyboardShortcutType) => {\n const onKeypress = useCallback(\n (event: KeyboardEvent) => {\n if (isDisabled) return;\n\n let shouldExclude = false;\n const activeElement = document.activeElement;\n\n if (excludedActiveElementId) {\n shouldExclude = !!activeElement?.id && excludedActiveElementId.includes(activeElement.id);\n }\n\n if (excludedActiveElements && !shouldExclude) {\n shouldExclude = excludedActiveElements.includes(\n \n activeElement?.tagName.toLowerCase() as keyof HTMLElementTagNameMap\n );\n }\n\n const isShortcut = event.key === key && (isSingleKey || event.metaKey || event.ctrlKey);\n if (isShortcut && !shouldExclude) {\n event.preventDefault();\n void callback?.();\n }\n },\n [callback, key, isSingleKey, excludedActiveElementId, excludedActiveElements, isDisabled]\n );\n\n useEffect(() => {\n addEventListener('keydown', onKeypress);\n return () => removeEventListener('keydown', onKeypress);\n }, [onKeypress]);\n};\n"],"names":["useKeyboardShortcut","key","callback","isSingleKey","excludedActiveElementId","excludedActiveElements","isDisabled","onKeypress","useCallback","event","shouldExclude","activeElement","useEffect"],"mappings":";AAYO,MAAMA,IAAsB,CAAC;AAAA,EAClC,KAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC;AAAA,EACA,yBAAAC;AAAA,EACA,wBAAAC;AAAA,EACA,YAAAC;AACF,MAA+B;AAC7B,QAAMC,IAAaC;AAAA,IACjB,CAACC,MAAyB;AACxB,UAAIH,EAAY;AAEhB,UAAII,IAAgB;AACpB,YAAMC,IAAgB,SAAS;AAE/B,MAAIP,MACFM,IAAgB,CAAC,EAACC,KAAA,QAAAA,EAAe,OAAMP,EAAwB,SAASO,EAAc,EAAE,IAGtFN,KAA0B,CAACK,MAC7BA,IAAgBL,EAAuB;AAAA,QAErCM,KAAA,gBAAAA,EAAe,QAAQ;AAAA,MAAY,IAIpBF,EAAM,QAAQR,MAAQE,KAAeM,EAAM,WAAWA,EAAM,YAC7D,CAACC,MACjBD,EAAM,eAAA,GACDP,KAAA,QAAAA;AAAA,IAET;AAAA,IACA,CAACA,GAAUD,GAAKE,GAAaC,GAAyBC,GAAwBC,CAAU;AAAA,EAAA;AAG1F,EAAAM,EAAU,OACR,iBAAiB,WAAWL,CAAU,GAC/B,MAAM,oBAAoB,WAAWA,CAAU,IACrD,CAACA,CAAU,CAAC;AACjB;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useMDXContent.js","sources":["../../src/hooks/useMDXContent.ts"],"sourcesContent":["'use client';\n\nimport { useContext } from 'react';\n\nimport { MDXContentContext } from '../contexts/MDXContentContext';\n\nexport const useMDXContent = () => useContext(MDXContentContext);\n"],"names":["useMDXContent","useContext","MDXContentContext"],"mappings":";;AAMO,MAAMA,IAAgB,MAAMC,EAAWC,CAAiB;"}
1
+ {"version":3,"file":"useMDXContent.js","sources":["../../src/hooks/useMDXContent.ts"],"sourcesContent":["\nimport { useContext } from 'react';\n\nimport { MDXContentContext } from '../contexts/MDXContentContext';\n\nexport const useMDXContent = () => useContext(MDXContentContext);\n"],"names":["useMDXContent","useContext","MDXContentContext"],"mappings":";;AAKO,MAAMA,IAAgB,MAAMC,EAAWC,CAAiB;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useApiPlaygroundInputs.js","sources":["../../../src/hooks/useMDXContentController/useApiPlaygroundInputs.ts"],"sourcesContent":["'use client';\n\nimport { useMemo } from 'react';\n\nimport { useApiPlaygroundInputs as useApiPlaygroundInputsCtx } from '@/hooks/useApiPlaygroundInputs';\n\nexport const useApiPlaygroundInputs = () => {\n const [context] = useApiPlaygroundInputsCtx();\n return useMemo(() => {\n return context;\n }, [context]);\n};\n"],"names":["useApiPlaygroundInputs","context","useApiPlaygroundInputsCtx","useMemo"],"mappings":";;AAMO,MAAMA,IAAyB,MAAM;AAC1C,QAAM,CAACC,CAAO,IAAIC,EAAA;AAClB,SAAOC,EAAQ,MACNF,GACN,CAACA,CAAO,CAAC;AACd;"}
1
+ {"version":3,"file":"useApiPlaygroundInputs.js","sources":["../../../src/hooks/useMDXContentController/useApiPlaygroundInputs.ts"],"sourcesContent":["\nimport { useMemo } from 'react';\n\nimport { useApiPlaygroundInputs as useApiPlaygroundInputsCtx } from '@/hooks/useApiPlaygroundInputs';\n\nexport const useApiPlaygroundInputs = () => {\n const [context] = useApiPlaygroundInputsCtx();\n return useMemo(() => {\n return context;\n }, [context]);\n};\n"],"names":["useApiPlaygroundInputs","context","useApiPlaygroundInputsCtx","useMemo"],"mappings":";;AAKO,MAAMA,IAAyB,MAAM;AAC1C,QAAM,CAACC,CAAO,IAAIC,EAAA;AAClB,SAAOC,EAAQ,MACNF,GACN,CAACA,CAAO,CAAC;AACd;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useSetApiBaseIndexCallback.js","sources":["../../../../src/hooks/useMDXContentController/useMDXContentCallbacks/useSetApiBaseIndexCallback.ts"],"sourcesContent":["'use client';\n\nimport { useCallback } from 'react';\n\nimport { useMDXContent } from '@/hooks/useMDXContent';\n\nexport const useSetApiBaseIndexCallback = () => {\n const [, dispatch] = useMDXContent();\n return useCallback(\n (x: number) =>\n dispatch({\n type: 'set_api_base_index',\n payload: x,\n }),\n [dispatch]\n );\n};\n"],"names":["useSetApiBaseIndexCallback","dispatch","useMDXContent","useCallback","x"],"mappings":";;AAMO,MAAMA,IAA6B,MAAM;AAC9C,QAAM,CAAA,EAAGC,CAAQ,IAAIC,EAAA;AACrB,SAAOC;AAAA,IACL,CAACC,MACCH,EAAS;AAAA,MACP,MAAM;AAAA,MACN,SAASG;AAAA,IAAA,CACV;AAAA,IACH,CAACH,CAAQ;AAAA,EAAA;AAEb;"}
1
+ {"version":3,"file":"useSetApiBaseIndexCallback.js","sources":["../../../../src/hooks/useMDXContentController/useMDXContentCallbacks/useSetApiBaseIndexCallback.ts"],"sourcesContent":["\nimport { useCallback } from 'react';\n\nimport { useMDXContent } from '@/hooks/useMDXContent';\n\nexport const useSetApiBaseIndexCallback = () => {\n const [, dispatch] = useMDXContent();\n return useCallback(\n (x: number) =>\n dispatch({\n type: 'set_api_base_index',\n payload: x,\n }),\n [dispatch]\n );\n};\n"],"names":["useSetApiBaseIndexCallback","dispatch","useMDXContent","useCallback","x"],"mappings":";;AAKO,MAAMA,IAA6B,MAAM;AAC9C,QAAM,CAAA,EAAGC,CAAQ,IAAIC,EAAA;AACrB,SAAOC;AAAA,IACL,CAACC,MACCH,EAAS;AAAA,MACP,MAAM;AAAA,MACN,SAASG;AAAA,IAAA,CACV;AAAA,IACH,CAACH,CAAQ;AAAA,EAAA;AAEb;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useSetApiPlaygroundInputsCallback.js","sources":["../../../../src/hooks/useMDXContentController/useMDXContentCallbacks/useSetApiPlaygroundInputsCallback.ts"],"sourcesContent":["'use client';\n\nimport { ApiPlaygroundInputs } from '@mintlify/validation';\nimport { useCallback } from 'react';\n\nimport { useApiPlaygroundInputs } from '@/hooks/useApiPlaygroundInputs';\n\nexport const useSetApiPlaygroundInputsCallback = () => {\n const [, dispatch] = useApiPlaygroundInputs();\n return useCallback(\n (inputs: ApiPlaygroundInputs) =>\n dispatch({\n type: 'set_api_playground_inputs',\n payload: inputs,\n }),\n [dispatch]\n );\n};\n"],"names":["useSetApiPlaygroundInputsCallback","dispatch","useApiPlaygroundInputs","useCallback","inputs"],"mappings":";;AAOO,MAAMA,IAAoC,MAAM;AACrD,QAAM,CAAA,EAAGC,CAAQ,IAAIC,EAAA;AACrB,SAAOC;AAAA,IACL,CAACC,MACCH,EAAS;AAAA,MACP,MAAM;AAAA,MACN,SAASG;AAAA,IAAA,CACV;AAAA,IACH,CAACH,CAAQ;AAAA,EAAA;AAEb;"}
1
+ {"version":3,"file":"useSetApiPlaygroundInputsCallback.js","sources":["../../../../src/hooks/useMDXContentController/useMDXContentCallbacks/useSetApiPlaygroundInputsCallback.ts"],"sourcesContent":["\nimport { ApiPlaygroundInputs } from '@mintlify/validation';\nimport { useCallback } from 'react';\n\nimport { useApiPlaygroundInputs } from '@/hooks/useApiPlaygroundInputs';\n\nexport const useSetApiPlaygroundInputsCallback = () => {\n const [, dispatch] = useApiPlaygroundInputs();\n return useCallback(\n (inputs: ApiPlaygroundInputs) =>\n dispatch({\n type: 'set_api_playground_inputs',\n payload: inputs,\n }),\n [dispatch]\n );\n};\n"],"names":["useSetApiPlaygroundInputsCallback","dispatch","useApiPlaygroundInputs","useCallback","inputs"],"mappings":";;AAMO,MAAMA,IAAoC,MAAM;AACrD,QAAM,CAAA,EAAGC,CAAQ,IAAIC,EAAA;AACrB,SAAOC;AAAA,IACL,CAACC,MACCH,EAAS;AAAA,MACP,MAAM;AAAA,MACN,SAASG;AAAA,IAAA,CACV;AAAA,IACH,CAACH,CAAQ;AAAA,EAAA;AAEb;"}
@@ -1 +1 @@
1
- {"version":3,"file":"usePlaygroundSchemaOptions.js","sources":["../../src/hooks/usePlaygroundSchemaOptions.ts"],"sourcesContent":["'use client';\n\nimport {\n AnySchema,\n DataSchema,\n DataSchemaArray,\n IncrementalDataSchema,\n IncrementalDataSchemaArray,\n} from '@mintlify/validation';\nimport { useMemo } from 'react';\n\nimport { generateOptionLabels } from '@/openapi/generateOptionLabels';\nimport { ComponentSchemas } from '@/utils/api-reference/getApiReferenceData';\n\nimport { useComponentSchemas } from './useComponentSchemas';\n\nexport type NoAnyDataSchema = Exclude<DataSchema | IncrementalDataSchema, AnySchema>;\nexport type SchemaWithLabelInfo = {\n schema: NoAnyDataSchema;\n label: string;\n};\n\nexport const usePlaygroundSchemaOptions = (\n schemaArray: DataSchemaArray | IncrementalDataSchemaArray | null\n) => {\n const componentSchemas = useComponentSchemas();\n return useMemo(() => {\n if (!schemaArray) return [];\n return getCleanSchemaArray(schemaArray, componentSchemas, undefined);\n }, [schemaArray, componentSchemas]);\n};\n\nconst getCleanSchemaArray = (\n schemaArray: DataSchemaArray | IncrementalDataSchemaArray,\n componentSchemas: ComponentSchemas | undefined,\n userGroups: string[] | undefined\n): SchemaWithLabelInfo[] => {\n const nullable = schemaArray.some((schema) => schema.type === 'null');\n const allObjects = schemaArray.every((schema) => schema.type === 'object');\n\n const typeStrings = generateOptionLabels(\n schemaArray,\n componentSchemas,\n allObjects,\n nullable,\n userGroups,\n true\n );\n\n let firstAnySchema: AnySchema | undefined = undefined;\n\n // filter out all schemas with type `any`, while saving the first instance for meta info\n const filteredSchemaArray: NoAnyDataSchema[] = [];\n const filteredTypeStringArray: (string | null)[] = [];\n for (const schema of schemaArray) {\n if (schema.type === 'any') {\n firstAnySchema = firstAnySchema ?? schema;\n } else {\n filteredSchemaArray.push(schema);\n }\n }\n\n for (const typeString of typeStrings) {\n if (typeString === 'any') {\n filteredTypeStringArray.push(null);\n } else {\n filteredTypeStringArray.push(typeString);\n }\n }\n\n // push a bunch of schemas to represent the `any`\n if (firstAnySchema !== undefined) {\n const baseSchema: Pick<DataSchema, 'description' | 'required'> = {\n description: firstAnySchema.description,\n required: firstAnySchema.required,\n };\n\n // all schemas that aren't added here are subsets of these schemas (eg, integer is just a more restrictive number input)\n filteredSchemaArray.push(\n { ...baseSchema, type: 'string' },\n { ...baseSchema, type: 'number' },\n { ...baseSchema, type: 'boolean' },\n { ...baseSchema, type: 'object', properties: {} },\n { ...baseSchema, type: 'array', items: [{ type: 'any' }] },\n { ...baseSchema, type: 'null' }\n );\n }\n\n const typeLabelMappedSchemaArray = filteredSchemaArray.map((schema, i) => ({\n schema,\n label: filteredTypeStringArray[i] ?? schema.type,\n }));\n\n // return each schema-label pair, just using the type for schemas generated from the `any`\n return typeLabelMappedSchemaArray;\n};\n"],"names":["usePlaygroundSchemaOptions","schemaArray","componentSchemas","useComponentSchemas","useMemo","getCleanSchemaArray","userGroups","nullable","schema","allObjects","typeStrings","generateOptionLabels","firstAnySchema","filteredSchemaArray","filteredTypeStringArray","typeString","baseSchema","i"],"mappings":";;;AAsBO,MAAMA,IAA6B,CACxCC,MACG;AACH,QAAMC,IAAmBC,EAAA;AACzB,SAAOC,EAAQ,MACRH,IACEI,EAAoBJ,GAAaC,GAAkB,MAAS,IAD1C,CAAA,GAExB,CAACD,GAAaC,CAAgB,CAAC;AACpC,GAEMG,IAAsB,CAC1BJ,GACAC,GACAI,MAC0B;AAC1B,QAAMC,IAAWN,EAAY,KAAK,CAACO,MAAWA,EAAO,SAAS,MAAM,GAC9DC,IAAaR,EAAY,MAAM,CAACO,MAAWA,EAAO,SAAS,QAAQ,GAEnEE,IAAcC;AAAA,IAClBV;AAAA,IACAC;AAAA,IACAO;AAAA,IACAF;AAAA,IACAD;AAAA,EAEF;AAEA,MAAIM;AAGJ,QAAMC,IAAyC,CAAA,GACzCC,IAA6C,CAAA;AACnD,aAAWN,KAAUP;AACnB,IAAIO,EAAO,SAAS,QAClBI,IAAiBA,KAAkBJ,IAEnCK,EAAoB,KAAKL,CAAM;AAInC,aAAWO,KAAcL;AACvB,IAAIK,MAAe,QACjBD,EAAwB,KAAK,IAAI,IAEjCA,EAAwB,KAAKC,CAAU;AAK3C,MAAIH,MAAmB,QAAW;AAChC,UAAMI,IAA2D;AAAA,MAC/D,aAAaJ,EAAe;AAAA,MAC5B,UAAUA,EAAe;AAAA,IAAA;AAI3B,IAAAC,EAAoB;AAAA,MAClB,EAAE,GAAGG,GAAY,MAAM,SAAA;AAAA,MACvB,EAAE,GAAGA,GAAY,MAAM,SAAA;AAAA,MACvB,EAAE,GAAGA,GAAY,MAAM,UAAA;AAAA,MACvB,EAAE,GAAGA,GAAY,MAAM,UAAU,YAAY,CAAA,EAAC;AAAA,MAC9C,EAAE,GAAGA,GAAY,MAAM,SAAS,OAAO,CAAC,EAAE,MAAM,MAAA,CAAO,EAAA;AAAA,MACvD,EAAE,GAAGA,GAAY,MAAM,OAAA;AAAA,IAAO;AAAA,EAElC;AAQA,SANmCH,EAAoB,IAAI,CAACL,GAAQS,OAAO;AAAA,IACzE,QAAAT;AAAA,IACA,OAAOM,EAAwBG,CAAC,KAAKT,EAAO;AAAA,EAAA,EAC5C;AAIJ;"}
1
+ {"version":3,"file":"usePlaygroundSchemaOptions.js","sources":["../../src/hooks/usePlaygroundSchemaOptions.ts"],"sourcesContent":["\nimport {\n AnySchema,\n DataSchema,\n DataSchemaArray,\n IncrementalDataSchema,\n IncrementalDataSchemaArray,\n} from '@mintlify/validation';\nimport { useMemo } from 'react';\n\nimport { generateOptionLabels } from '@/openapi/generateOptionLabels';\nimport { ComponentSchemas } from '@/utils/api-reference/getApiReferenceData';\n\nimport { useComponentSchemas } from './useComponentSchemas';\n\nexport type NoAnyDataSchema = Exclude<DataSchema | IncrementalDataSchema, AnySchema>;\nexport type SchemaWithLabelInfo = {\n schema: NoAnyDataSchema;\n label: string;\n};\n\nexport const usePlaygroundSchemaOptions = (\n schemaArray: DataSchemaArray | IncrementalDataSchemaArray | null\n) => {\n const componentSchemas = useComponentSchemas();\n return useMemo(() => {\n if (!schemaArray) return [];\n return getCleanSchemaArray(schemaArray, componentSchemas, undefined);\n }, [schemaArray, componentSchemas]);\n};\n\nconst getCleanSchemaArray = (\n schemaArray: DataSchemaArray | IncrementalDataSchemaArray,\n componentSchemas: ComponentSchemas | undefined,\n userGroups: string[] | undefined\n): SchemaWithLabelInfo[] => {\n const nullable = schemaArray.some((schema) => schema.type === 'null');\n const allObjects = schemaArray.every((schema) => schema.type === 'object');\n\n const typeStrings = generateOptionLabels(\n schemaArray,\n componentSchemas,\n allObjects,\n nullable,\n userGroups,\n true\n );\n\n let firstAnySchema: AnySchema | undefined = undefined;\n\n // filter out all schemas with type `any`, while saving the first instance for meta info\n const filteredSchemaArray: NoAnyDataSchema[] = [];\n const filteredTypeStringArray: (string | null)[] = [];\n for (const schema of schemaArray) {\n if (schema.type === 'any') {\n firstAnySchema = firstAnySchema ?? schema;\n } else {\n filteredSchemaArray.push(schema);\n }\n }\n\n for (const typeString of typeStrings) {\n if (typeString === 'any') {\n filteredTypeStringArray.push(null);\n } else {\n filteredTypeStringArray.push(typeString);\n }\n }\n\n // push a bunch of schemas to represent the `any`\n if (firstAnySchema !== undefined) {\n const baseSchema: Pick<DataSchema, 'description' | 'required'> = {\n description: firstAnySchema.description,\n required: firstAnySchema.required,\n };\n\n // all schemas that aren't added here are subsets of these schemas (eg, integer is just a more restrictive number input)\n filteredSchemaArray.push(\n { ...baseSchema, type: 'string' },\n { ...baseSchema, type: 'number' },\n { ...baseSchema, type: 'boolean' },\n { ...baseSchema, type: 'object', properties: {} },\n { ...baseSchema, type: 'array', items: [{ type: 'any' }] },\n { ...baseSchema, type: 'null' }\n );\n }\n\n const typeLabelMappedSchemaArray = filteredSchemaArray.map((schema, i) => ({\n schema,\n label: filteredTypeStringArray[i] ?? schema.type,\n }));\n\n // return each schema-label pair, just using the type for schemas generated from the `any`\n return typeLabelMappedSchemaArray;\n};\n"],"names":["usePlaygroundSchemaOptions","schemaArray","componentSchemas","useComponentSchemas","useMemo","getCleanSchemaArray","userGroups","nullable","schema","allObjects","typeStrings","generateOptionLabels","firstAnySchema","filteredSchemaArray","filteredTyp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L,GAAQS,OAAO;AAAA,IACzE,QAAAT;AAAA,IACA,OAAOM,EAAwBG,CAAC,KAAKT,EAAO;AAAA,EAAA,EAC5C;AAIJ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/hooks/usePrefilledInputs/index.ts"],"sourcesContent":["'use client';\n\nimport {\n ApiPlaygroundInputs,\n UserInfoInputs,\n SecurityOption,\n SecurityParameterSchema,\n} from '@mintlify/validation';\nimport { useEffect, useState } from 'react';\n\nimport {\n ServerVariableStore,\n loadServerVariableStore,\n storeServerVariables,\n} from './storedServerVariables';\n\nexport type SecurityInputs = Pick<ApiPlaygroundInputs, 'query' | 'header' | 'cookie'>;\n\ntype UsePrefilledInputsParams = {\n inputs: ApiPlaygroundInputs;\n setInputs: (inputs: ApiPlaygroundInputs) => void;\n baseUrl?: string;\n securityOption?: SecurityOption;\n userInfoInputs?: UserInfoInputs;\n};\n\nexport function usePrefilledInputs({\n inputs,\n setInputs,\n baseUrl,\n securityOption,\n userInfoInputs,\n}: UsePrefilledInputsParams) {\n const [serverVariableStore, setServerVariableStore] = useState<ServerVariableStore>();\n\n useEffect(() => {\n setServerVariableStore(loadServerVariableStore());\n }, []);\n\n useEffect(() => {\n const authInputs = parseAuthInputs(securityOption, undefined, userInfoInputs);\n const serverInputs = parseServerInputs(baseUrl, serverVariableStore, userInfoInputs);\n\n setInputs({\n ...authInputs,\n server: serverInputs,\n path: inputs.path,\n body: inputs.body,\n });\n // these values should only ever change on page load\n }, [serverVariableStore, userInfoInputs]);\n\n // load security variables\n useEffect(() => {\n const authInputs = parseAuthInputs(securityOption, undefined, userInfoInputs);\n setInputs({ ...inputs, ...authInputs });\n // we only want to update the security variables when the security option changes\n }, [securityOption]);\n\n\n\n // load server variables\n useEffect(() => {\n const serverInputs = parseServerInputs(baseUrl, serverVariableStore, userInfoInputs);\n setInputs({ ...inputs, server: serverInputs });\n // we only want to update the server variables when the base url changes\n }, [baseUrl]);\n\n // store server variables\n useEffect(() => {\n if (!baseUrl) return;\n storeServerVariables(baseUrl, inputs.server, userInfoInputs);\n // we only want to store the server variables when their values change\n }, [inputs.server]);\n}\n\nexport const parseAuthInputs = (\n securityOption: SecurityOption | undefined,\n credentialStore: SecurityInputs | undefined,\n userInfoInputs: UserInfoInputs | undefined\n): SecurityInputs => {\n const inputs: SecurityInputs = {\n query: {},\n header: {},\n cookie: {},\n };\n\n if (!securityOption) {\n return inputs;\n }\n\n for (const section of ['query', 'header', 'cookie'] as const) {\n Object.entries(securityOption.parameters[section]).forEach(([name, schema]) => {\n inputs[section][name] =\n credentialStore?.[section][name] ??\n cleanUserInfoValue(userInfoInputs?.[section]?.[name], schema);\n });\n }\n return inputs;\n};\n\n// do a bit of preprocessing for common auth types\nconst cleanUserInfoValue = (value: unknown, schema: SecurityParameterSchema) => {\n if (!value) return value;\n\n if (schema.type === 'http' && schema.scheme === 'basic') {\n if (typeof value === 'object') {\n const username =\n 'username' in value && typeof value.username === 'string' ? value.username : '';\n const password =\n 'password' in value && typeof value.password === 'string' ? value.password : '';\n return `Basic ${Buffer.from(`${username}:${password}`).toString('base64')}`;\n }\n return undefined;\n }\n\n if (schema.type === 'http' && schema.scheme === 'bearer') {\n if (typeof value === 'string') {\n return value.startsWith('Bearer ') ? value : `Bearer ${value}`;\n }\n return undefined;\n }\n\n return value;\n};\n\nconst parseServerInputs = (\n baseUrl: string | undefined,\n serverVariableStore: ServerVariableStore | undefined,\n userInfoInputs: UserInfoInputs | undefined\n): Record<string, string> => {\n const userInfoServerVariables = userInfoInputs?.server;\n const storedServerVariables =\n serverVariableStore && baseUrl ? serverVariableStore[baseUrl] : undefined;\n\n return { ...userInfoServerVariables, ...storedServerVariables };\n};\n\nexport const parseAuthInputsFromUserInfo = (\n securityOption: SecurityOption | undefined,\n userInfoInputs: UserInfoInputs | undefined\n): Pick<ApiPlaygroundInputs, 'query' | 'header' | 'cookie'> => {\n const inputs: Pick<ApiPlaygroundInputs, 'query' | 'header' | 'cookie'> = {\n query: {},\n header: {},\n cookie: {},\n };\n\n if (!securityOption) {\n return inputs;\n }\n\n for (const section of ['query', 'header', 'cookie'] as const) {\n Object.entries(securityOption.parameters[section]).forEach(([name, schema]) => {\n const userInfoValue = userInfoInputs?.[section]?.[name];\n if (userInfoValue !== undefined) {\n inputs[section][name] = cleanUserInfoValue(userInfoValue, schema);\n }\n });\n }\n return inputs;\n};\n"],"names":["usePrefilledInputs","inputs","setInputs","baseUrl","securityOption","userInfoInputs","serverVariableStore","setServerVariableStore","useState","useEffect","loadServerVariableStore","authInputs","parseAuthInputs","serverInputs","parseServerInputs","storeServerVariables","credentialStore","section","name","schema","cleanUserInfoValue","_a","value","userInfoServerVariables","storedServerVariables","parseAuthInputsFromUserInfo"],"mappings":";;AA0BO,SAASA,EAAmB;AAAA,EACjC,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,gBAAAC;AACF,GAA6B;AAC3B,QAAM,CAACC,GAAqBC,CAAsB,IAAIC,EAAA;AAEtD,EAAAC,EAAU,MAAM;AACd,IAAAF,EAAuBG,GAAyB;AAAA,EAClD,GAAG,CAAA,CAAE,GAELD,EAAU,MAAM;AACd,UAAME,IAAaC,EAAgBR,GAAgB,QAAWC,CAAc,GACtEQ,IAAeC,EAAkBX,GAASG,GAAqBD,CAAc;AAEnF,IAAAH,EAAU;AAAA,MACR,GAAGS;AAAA,MACH,QAAQE;AAAA,MACR,MAAMZ,EAAO;AAAA,MACb,MAAMA,EAAO;AAAA,IAAA,CACd;AAAA,EAEH,GAAG,CAACK,GAAqBD,CAAc,CAAC,GAGxCI,EAAU,MAAM;AACd,UAAME,IAAaC,EAAgBR,GAAgB,QAAWC,CAAc;AAC5E,IAAAH,EAAU,EAAE,GAAGD,GAAQ,GAAGU,GAAY;AAAA,EAExC,GAAG,CAACP,CAAc,CAAC,GAKnBK,EAAU,MAAM;AACd,UAAMI,IAAeC,EAAkBX,GAASG,GAAqBD,CAAc;AACnF,IA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K/E,CAAC;AAEH,SAAOlB;AACT;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/hooks/usePrefilledInputs/index.ts"],"sourcesContent":["\nimport {\n ApiPlaygroundInputs,\n UserInfoInputs,\n SecurityOption,\n SecurityParameterSchema,\n} from '@mintlify/validation';\nimport { useEffect, useState } from 'react';\n\nimport {\n ServerVariableStore,\n loadServerVariableStore,\n storeServerVariables,\n} from './storedServerVariables';\n\nexport type SecurityInputs = Pick<ApiPlaygroundInputs, 'query' | 'header' | 'cookie'>;\n\ntype UsePrefilledInputsParams = {\n inputs: ApiPlaygroundInputs;\n setInputs: (inputs: ApiPlaygroundInputs) => void;\n baseUrl?: string;\n securityOption?: SecurityOption;\n userInfoInputs?: UserInfoInputs;\n};\n\nexport function usePrefilledInputs({\n inputs,\n setInputs,\n baseUrl,\n securityOption,\n userInfoInputs,\n}: UsePrefilledInputsParams) {\n const [serverVariableStore, setServerVariableStore] = useState<ServerVariableStore>();\n\n useEffect(() => {\n setServerVariableStore(loadServerVariableStore());\n }, []);\n\n useEffect(() => {\n const authInputs = parseAuthInputs(securityOption, undefined, userInfoInputs);\n const serverInputs = parseServerInputs(baseUrl, serverVariableStore, userInfoInputs);\n\n setInputs({\n ...authInputs,\n server: serverInputs,\n path: inputs.path,\n body: inputs.body,\n });\n // these values should only ever change on page load\n }, [serverVariableStore, userInfoInputs]);\n\n // load security variables\n useEffect(() => {\n const authInputs = parseAuthInputs(securityOption, undefined, userInfoInputs);\n setInputs({ ...inputs, ...authInputs });\n // we only want to update the security variables when the security option changes\n }, [securityOption]);\n\n\n\n // load server variables\n useEffect(() => {\n const serverInputs = parseServerInputs(baseUrl, serverVariableStore, userInfoInputs);\n setInputs({ ...inputs, server: serverInputs });\n // we only want to update the server variables when the base url changes\n }, [baseUrl]);\n\n // store server variables\n useEffect(() => {\n if (!baseUrl) return;\n storeServerVariables(baseUrl, inputs.server, userInfoInputs);\n // we only want to store the server variables when their values change\n }, [inputs.server]);\n}\n\nexport const parseAuthInputs = (\n securityOption: SecurityOption | undefined,\n credentialStore: SecurityInputs | undefined,\n userInfoInputs: UserInfoInputs | undefined\n): SecurityInputs => {\n const inputs: SecurityInputs = {\n query: {},\n header: {},\n cookie: {},\n };\n\n if (!securityOption) {\n return inputs;\n }\n\n for (const section of ['query', 'header', 'cookie'] as const) {\n Object.entries(securityOption.parameters[section]).forEach(([name, schema]) => {\n inputs[section][name] =\n credentialStore?.[section][name] ??\n cleanUserInfoValue(userInfoInputs?.[section]?.[name], schema);\n });\n }\n return inputs;\n};\n\n// do a bit of preprocessing for common auth types\nconst cleanUserInfoValue = (value: unknown, schema: SecurityParameterSchema) => {\n if (!value) return value;\n\n if (schema.type === 'http' && schema.scheme === 'basic') {\n if (typeof value === 'object') {\n const username =\n 'username' in value && typeof value.username === 'string' ? value.username : '';\n const password =\n 'password' in value && typeof value.password === 'string' ? value.password : '';\n return `Basic ${Buffer.from(`${username}:${password}`).toString('base64')}`;\n }\n return undefined;\n }\n\n if (schema.type === 'http' && schema.scheme === 'bearer') {\n if (typeof value === 'string') {\n return value.startsWith('Bearer ') ? value : `Bearer ${value}`;\n }\n return undefined;\n }\n\n return value;\n};\n\nconst parseServerInputs = (\n baseUrl: string | undefined,\n serverVariableStore: ServerVariableStore | undefined,\n userInfoInputs: UserInfoInputs | undefined\n): Record<string, string> => {\n const userInfoServerVariables = userInfoInputs?.server;\n const storedServerVariables =\n serverVariableStore && baseUrl ? serverVariableStore[baseUrl] : undefined;\n\n return { ...userInfoServerVariables, ...storedServerVariables };\n};\n\nexport const parseAuthInputsFromUserInfo = (\n securityOption: SecurityOption | undefined,\n userInfoInputs: UserInfoInputs | undefined\n): Pick<ApiPlaygroundInputs, 'query' | 'header' | 'cookie'> => {\n const inputs: Pick<ApiPlaygroundInputs, 'query' | 'header' | 'cookie'> = {\n query: {},\n header: {},\n cookie: {},\n };\n\n if (!securityOption) {\n return inputs;\n }\n\n for (const section of ['query', 'header', 'cookie'] as const) {\n Object.entries(securityOption.parameters[section]).forEach(([name, schema]) => {\n const userInfoValue = userInfoInputs?.[section]?.[name];\n if (userInfoValue !== undefined) {\n inputs[section][name] = cleanUserInfoValue(userInfoValue, schema);\n }\n });\n }\n return inputs;\n};\n"],"names":["usePrefilledInputs","inputs","setInputs","baseUrl","securityOption","userInfoInputs","serverVariableStore","setServerVariableStore","useState","useEffect","loadServerVariableStore","authInputs","parseAuthInputs","serverInputs","parseServerInputs","storeServerVariables","credentialStore","section","name","schema","cleanUserInfoValue","_a","value","userInfoServerVariables","storedServerVariables","parseAuthInputsFromUserInfo"],"mappings":";;AAyBO,SAASA,EAAmB;AAAA,EACjC,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,gBAAAC;AACF,GAA6B;AAC3B,QAAM,CAACC,GAAqBC,CAAsB,IAAIC,EAAA;AAEtD,EAAAC,EAAU,MAAM;AACd,IAAAF,EAAuBG,GAAyB;AAAA,EAClD,GAAG,CAAA,CAAE,GAELD,EAAU,MAAM;AACd,UAAME,IAAaC,EAAgBR,GAAgB,QAAWC,CAAc,GACtEQ,IAAeC,EAAkBX,GAASG,GAAqBD,CAAc;AAEnF,IAAAH,EAAU;AAAA,MACR,GAAGS;AAAA,MACH,QAAQE;AAAA,MACR,MAAMZ,EAAO;AAAA,MACb,MAAMA,EAAO;AAAA,IAAA,CACd;AAAA,EAEH,GAAG,CAACK,GAAqBD,CAAc,CAAC,GAGxCI,EAAU,MAAM;AACd,UAAME,IAAaC,EAAgBR,GAAgB,QAAWC,CAAc;AAC5E,IAAAH,EAAU,EAAE,GAAGD,GAAQ,GAAGU,GAAY;AAAA,EAExC,GAAG,CAACP,CAAc,CAAC,GAKnBK,EAAU,MAAM;AACd,UAAMI,IAAeC,EAAkBX,GAASG,GAAqBD,CAAc;AACnF,IAAAH,EAAU,EAAE,GAAGD,GAAQ,QAAQY,GAAc;AAAA,EAE/C,GAAG,CAACV,CAAO,CAAC,GAGZM,EAAU,MA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ledInputs/storedServerVariables.ts"],"sourcesContent":["'use client';\n\nimport { UserInfoInputs } from '@mintlify/validation';\n\nconst SERVERVARS_LOCALSTORAGE_KEY = 'mintlify-server-variables';\n\nexport type ServerVariableStore = Record<string, Record<string, string>>;\n\nconst isValidServerVariableStore = (info: unknown): info is ServerVariableStore => {\n if (typeof info !== 'object' || info == null) {\n return false;\n }\n\n const infoObj = info as Record<string, unknown>;\n return Object.values(infoObj).every(\n (inputMap) =>\n typeof inputMap === 'object' &&\n inputMap !== null &&\n Object.values(inputMap).every((input) => typeof input === 'string')\n );\n};\n\nexport const loadServerVariableStore = (): ServerVariableStore => {\n const inputString = localStorage.getItem(SERVERVARS_LOCALSTORAGE_KEY);\n\n if (inputString) {\n try {\n const inputs = JSON.parse(inputString);\n if (isValidServerVariableStore(inputs)) {\n return inputs;\n }\n } catch (e) {\n console.log(`unable to parse stored server variables: ${e}`);\n }\n }\n\n return {};\n};\n\nexport const storeServerVariables = (\n baseUrl: string,\n serverVariables: Record<string, string>,\n userInfoInputs: UserInfoInputs | undefined\n) => {\n // only store the variables that differ from those in user info\n const meaningfulServerVariables = Object.fromEntries(\n Object.entries(serverVariables).filter(([name, value]) => {\n return value && userInfoInputs?.server?.[name] !== value;\n })\n );\n\n const existingServerVariableStore = loadServerVariableStore();\n const newServerVariableStore = {\n ...existingServerVariableStore,\n [baseUrl]: meaningfulServerVariables,\n };\n const serverVariableString = JSON.stringify(newServerVariableStore);\n localStorage.setItem(SERVERVARS_LOCALSTORAGE_KEY, serverVariableString);\n};\n"],"names":["SERVERVARS_LOCALSTORAGE_KEY","isValidServerVariableStore","info","inputMap","input","loadServerVariableStore","inputString","inputs","e","storeServerVariables","baseUrl","serverVariables","userInfoInputs","meaningfulServerVariables","name","value","_a","newServerVariableStore","serverVariableString"],"mappings":"AAIA,MAAMA,IAA8B,6BAI9BC,IAA6B,CAACC,MAC9B,OAAOA,KAAS,YAAYA,KAAQ,OAC/B,KAIF,OAAO,OADEA,CACY,EAAE;AAAA,EAC5B,CAACC,MACC,OAAOA,KAAa,YACpBA,MAAa,QACb,OAAO,OAAOA,CAAQ,EAAE,MAAM,CAACC,MAAU,OAAOA,KAAU,QAAQ;AAAA,GAI3DC,IAA0B,MAA2B;AAChE,QAAMC,IAAc,aAAa,QAAQN,CAA2B;AAEpE,MAAIM;AACF,QAAI;AACF,YAAMC,IAAS,KAAK,MAAMD,CAAW;AACrC,UAAIL,EAA2BM,CAAM;AACnC,eAAOA;AAAA,IAEX,SAASC,GAAG;AACV,cAAQ,IAAI,4CAA4CA,CAAC,EAAE;AAAA,IAC7D;AAGF,SAAO,CAAA;AACT,GAEaC,IAAuB,CAClCC,GACAC,GACAC,MACG;AAEH,QAAMC,IAA4B,OAAO;AAAA,IACvC,OAAO,QAAQF,CAAe,EAAE,OAAO,CAAC,CAACG,GAAMC,CAAK,MAAM;AA1C9D,UAAAC;AA2CM,aAAOD,OAASC,IAAAJ,KAAA,gBAAAA,EAAgB,WAAhB,gBAAAI,EAAyBF,QAAUC;AAAA,IACrD,CAAC;AAAA,EAAA,GAIGE,IAAyB;AAAA,IAC7B,GAFkCZ,EAAA;AAAA,IAGlC,CAACK,CAAO,GAAGG;AAAA,EAAA,GAEPK,IAAuB,KAAK,UAAUD,CAAsB;AAClE,eAAa,QAAQjB,GAA6BkB,CAAoB;AACxE;"}
1
+ {"version":3,"file":"storedServerVariables.js","sources":["../../../src/hooks/usePrefilledInputs/storedServerVariables.ts"],"sourcesContent":["\nimport { UserInfoInputs } from '@mintlify/validation';\n\nconst SERVERVARS_LOCALSTORAGE_KEY = 'mintlify-server-variables';\n\nexport type ServerVariableStore = Record<string, Record<string, string>>;\n\nconst isValidServerVariableStore = (info: unknown): info is ServerVariableStore => {\n if (typeof info !== 'object' || info == null) {\n return false;\n }\n\n const infoObj = info as Record<string, unknown>;\n return Object.values(infoObj).every(\n (inputMap) =>\n typeof inputMap === 'object' &&\n inputMap !== null &&\n Object.values(inputMap).every((input) => typeof input === 'string')\n );\n};\n\nexport const loadServerVariableStore = (): ServerVariableStore => {\n const inputString = localStorage.getItem(SERVERVARS_LOCALSTORAGE_KEY);\n\n if (inputString) {\n try {\n const inputs = JSON.parse(inputString);\n if (isValidServerVariableStore(inputs)) {\n return inputs;\n }\n } catch (e) {\n console.log(`unable to parse stored server variables: ${e}`);\n }\n }\n\n return {};\n};\n\nexport const storeServerVariables = (\n baseUrl: string,\n serverVariables: Record<string, string>,\n userInfoInputs: UserInfoInputs | undefined\n) => {\n // only store the variables that differ from those in user info\n const meaningfulServerVariables = Object.fromEntries(\n Object.entries(serverVariables).filter(([name, value]) => {\n return value && userInfoInputs?.server?.[name] !== value;\n })\n );\n\n const existingServerVariableStore = loadServerVariableStore();\n const newServerVariableStore = {\n ...existingServerVariableStore,\n [baseUrl]: meaningfulServerVariables,\n };\n const serverVariableString = JSON.stringify(newServerVariableStore);\n localStorage.setItem(SERVERVARS_LOCALSTORAGE_KEY, serverVariableString);\n};\n"],"names":["SERVERVARS_LOCALSTORAGE_KEY","isValidServerVariableStore","info","inputMap","input","loadServerVariableStore","inputString","inputs","e","storeServerVariables","baseUrl","serverVariables","userInfoInputs","meaningfulServerVariables","name","value","_a","newServerVariableStore","serverVariableString"],"mappings":"AAGA,MAAMA,IAA8B,6BAI9BC,IAA6B,CAACC,MAC9B,OAAOA,KAAS,YAAYA,KAAQ,OAC/B,KAIF,OAAO,OADEA,CACY,EAAE;AAAA,EAC5B,CAACC,MACC,OAAOA,KAAa,YACpBA,MAAa,QACb,OAAO,OAAOA,CAAQ,EAAE,MAAM,CAACC,MAAU,OAAOA,KAAU,QAAQ;AAAA,GAI3DC,IAA0B,MAA2B;AAChE,QAAMC,IAAc,aAAa,QAAQN,CAA2B;AAEpE,MAAIM;AACF,QAAI;AACF,YAAMC,IAAS,KAAK,MAAMD,CAAW;AACrC,UAAIL,EAA2BM,CAAM;AACnC,eAAOA;AAAA,IAEX,SAASC,GAAG;AACV,cAAQ,IAAI,4CAA4CA,CAAC,EAAE;AAAA,IAC7D;AAGF,SAAO,CAAA;AACT,GAEaC,IAAuB,CAClCC,GACAC,GACAC,MACG;AAEH,QAAMC,IAA4B,OAAO;AAAA,IACvC,OAAO,QAAQF,CAAe,EAAE,OAAO,CAAC,CAACG,GAAMC,CAAK,MAAM;AA1C9D,UAAAC;AA2CM,aAAOD,OAASC,IAAAJ,KAAA,gBAAAA,EAAgB,WAAhB,gBAAAI,EAAyBF,QAAUC;AAAA,IACrD,CAAC;AAAA,EAAA,GAIGE,IAAyB;AAAA,IAC7B,GAFkCZ,EAAA;AAAA,IAGlC,CAACK,CAAO,GAAGG;AAAA,EAAA,GAEPK,IAAuB,KAAK,UAAUD,CAAsB;AAClE,eAAa,QAAQjB,GAA6BkB,CAAoB;AACxE;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useSecurityOption.js","sources":["../../src/hooks/useSecurityOption.ts"],"sourcesContent":["'use client';\n\nimport { SecurityOption } from '@mintlify/validation';\nimport { useState } from 'react';\n\n\nexport function useSecurityOption(baseOptions: SecurityOption[]) {\n const [selectedIndex, _setSelectedIndex] = useState(0);\n\n const nonemptyOptions = baseOptions.filter((option) =>\n Object.values(option.parameters).some((section) => Object.keys(section).length > 0)\n );\n\n const selectedSecurity = nonemptyOptions[selectedIndex];\n return selectedSecurity;\n}\n"],"names":["useSecurityOption","baseOptions","selectedIndex","_setSelectedIndex","useState","option","section"],"mappings":";AAMO,SAASA,EAAkBC,GAA+B;AAC/D,QAAM,CAACC,GAAeC,CAAiB,IAAIC,EAAS,CAAC;AAOrD,SALwBH,EAAY;AAAA,IAAO,CAACI,MACxC,OAAO,OAAOA,EAAO,UAAU,EAAE,KAAK,CAACC,MAAY,OAAO,KAAKA,CAAO,EAAE,SAAS,CAAC;AAAA,EAAA,EAG7CJ,CAAa;AAExD;"}
1
+ {"version":3,"file":"useSecurityOption.js","sources":["../../src/hooks/useSecurityOption.ts"],"sourcesContent":["\nimport { SecurityOption } from '@mintlify/validation';\nimport { useState } from 'react';\n\n\nexport function useSecurityOption(baseOptions: SecurityOption[]) {\n const [selectedIndex, _setSelectedIndex] = useState(0);\n\n const nonemptyOptions = baseOptions.filter((option) =>\n Object.values(option.parameters).some((section) => Object.keys(section).length > 0)\n );\n\n const selectedSecurity = nonemptyOptions[selectedIndex];\n return selectedSecurity;\n}\n"],"names":["useSecurityOption","baseOptions","selectedIndex","_setSelectedIndex","useState","option","section"],"mappings":";AAKO,SAASA,EAAkBC,GAA+B;AAC/D,QAAM,CAACC,GAAeC,CAAiB,IAAIC,EAAS,CAAC;AAOrD,SALwBH,EAAY;AAAA,IAAO,CAACI,MACxC,OAAO,OAAOA,EAAO,UAAU,EAAE,KAAK,CAACC,MAAY,OAAO,KAAKA,CAAO,EAAE,SAAS,CAAC;AAAA,EAAA,EAG7CJ,CAAa;AAExD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useSendPlaygroundRequest.js","sources":["../../src/hooks/useSendPlaygroundRequest.ts"],"sourcesContent":["\"use client\";\n\nimport { ApiPlaygroundResultType } from \"@mintlify/models\";\nimport { Endpoint, HttpMethod } from \"@mintlify/validation\";\nimport { AxiosResponse } from \"axios\";\nimport { useCallback, useContext } from \"react\";\n\nimport { DocsConfigContext } from \"@/contexts/ConfigContext\";\nimport { NEXT_PUBLIC } from \"@/env\";\n\nimport { useApiPlaygroundInputs } from \"./useMDXContentController/useApiPlaygroundInputs\";\n\nexport type UseSendPlaygroundRequestProps = {\n endpoint: Endpoint;\n baseUrl: string;\n contentType: string;\n setResult: (result: ApiPlaygroundResultType) => void;\n setIsFetching: (isFetching: boolean) => void;\n};\n\nexport type RequestInfo = {\n method: HttpMethod;\n url: string;\n header: Record<string, unknown>;\n query: Record<string, unknown>;\n cookie: Record<string, unknown>;\n body: unknown;\n};\n\nexport const useSendPlaygroundRequest = ({\n endpoint,\n baseUrl,\n contentType,\n setResult,\n setIsFetching,\n}: UseSendPlaygroundRequestProps) => {\n const inputs = useApiPlaygroundInputs();\n const { docsConfig } = useContext(DocsConfigContext);\n\n // TODO: Move to JS pre-processing script\n const disableProxy = docsConfig?.api?.playground?.proxy === false;\n\n return useCallback(async () => {\n setIsFetching(true);\n const axios = await import(\"axios\").then((x) => x.default);\n\n const pathWithInputs = addPathParams(endpoint.path, inputs.path);\n\n const url = joinWithSingleSlash(\n addServerVariables(baseUrl, inputs.server),\n pathWithInputs\n );\n\n const headers = addContentType(inputs.header, contentType);\n\n const request: RequestInfo = {\n method: endpoint.method,\n url,\n header: headers,\n body: inputs.body,\n cookie: inputs.cookie,\n query: inputs.query,\n };\n\n try {\n if (disableProxy) {\n const response = await performDirectRequest(request);\n setResult({\n error: false,\n response: {\n status: response.status,\n statusText: response.statusText,\n headers: response.headers,\n data: response.data,\n },\n });\n } else {\n if (contentType.includes(\"multipart/form-data\")) {\n const data = await performFileRequest(request);\n\n setResult(data);\n } else {\n const { data } = await axios.post<\n unknown,\n AxiosResponse<ApiPlaygroundResultType>\n >(`${NEXT_PUBLIC.BASE_PATH}/_mintlify/api/request`, request);\n\n setResult(data);\n }\n }\n } catch (err) {\n setResult({\n error: true,\n errorMessage: \"unable to complete request\",\n });\n console.error(err);\n }\n setIsFetching(false);\n }, [\n setIsFetching,\n endpoint,\n inputs,\n baseUrl,\n contentType,\n disableProxy,\n setResult,\n ]);\n};\n\nexport const addPathParams = (\n path: string,\n pathInputs: Record<string, unknown>\n) => {\n return Object.entries(pathInputs).reduce((path, [inputName, inputValue]) => {\n if (inputValue == undefined) return path;\n return path.replace(\n `{${inputName}}`,\n encodeURIComponent(inputValue.toString())\n );\n }, path);\n};\n\nexport const addServerVariables = (\n baseUrl: string,\n variables: Record<string, string>\n): string => {\n let url = baseUrl;\n Object.entries(variables).forEach(([key, input]) => {\n if (input) url = url.replace(`{${key}}`, input);\n });\n return url;\n};\n\nexport const joinWithSingleSlash = (baseUrl: string, path: string): string => {\n // remove the last slash of the baseUrl and the first slash of the path, and join with slash\n return baseUrl.replace(/\\/$/, \"\") + \"/\" + path.replace(/^\\//, \"\");\n};\n\nconst addContentType = (\n headers: Record<string, unknown>,\n contentType: string\n) => {\n if (\n Object.keys(headers).some((name) => name.toLowerCase() === \"content-type\")\n ) {\n return headers;\n }\n\n return {\n ...headers,\n [\"content-type\"]: contentType,\n };\n};\n\nconst performDirectRequest = async (request: RequestInfo) => {\n const axios = await import(\"axios\").then((it) => it.default);\n\n const contentType = Object.keys(request.header).find(\n (key) => key.toLowerCase() === \"content-type\"\n );\n let data = request.body;\n \n let headers = request.header as Record<string, string>;\n if (contentType?.includes(\"multipart/form-data\")) {\n const { data: formData, headers: formHeaders } = handleFormData(request);\n data = formData;\n headers = formHeaders;\n }\n\n return axios({\n url: request.url,\n method: request.method,\n params: request.query,\n data,\n headers,\n // prevent axios from adding [] after array query params\n paramsSerializer: {\n indexes: null,\n },\n responseType: \"arraybuffer\",\n // prevent axios from erroring on bad status codes\n validateStatus: () => true,\n // prevent axios from parsing json, losing whitespace information, and using default utf-8 encoding\n // we can't use `responseEncoding` as it's ignored client-side\n transformResponse: (data) => {\n return Buffer.from(data).toString(\"base64\");\n },\n });\n};\n\nconst performFileRequest = async (request: RequestInfo) => {\n const axios = await import(\"axios\").then((it) => it.default);\n const formData = new FormData();\n formData.append(\n \"requestInfo\",\n JSON.stringify({\n method: request.method,\n url: request.url,\n header: request.header,\n query: request.query,\n cookie: request.cookie,\n })\n );\n if (typeof request.body === \"object\" && request.body !== null) {\n Object.entries(request.body).forEach(([key, value]) => {\n if (value instanceof File) {\n formData.append(key, value);\n } else if (Array.isArray(value)) {\n value.forEach((item) => {\n if (item instanceof File) {\n formData.append(key, item);\n } else if (item !== undefined && item !== null) {\n formData.append(\n key,\n typeof item === \"object\" ? JSON.stringify(item) : item.toString()\n );\n }\n });\n } else if (value !== undefined && value !== null) {\n formData.append(\n key,\n typeof value === \"object\" ? JSON.stringify(value) : value.toString()\n );\n }\n });\n }\n\n const { data } = await axios.post<\n unknown,\n AxiosResponse<ApiPlaygroundResultType>\n >(`${NEXT_PUBLIC.BASE_PATH}/_mintlify/api/file-request`, formData);\n return data;\n};\n\nconst handleFormData = (request: RequestInfo) => {\n let data = request.body;\n \n const headers = request.header as Record<string, string>;\n\n if (headers[\"content-type\"]?.includes(\"multipart/form-data\")) {\n const formData = new FormData();\n if (typeof data === \"object\" && data !== null) {\n Object.entries(data).forEach(([key, value]) => {\n if (value instanceof File) {\n formData.append(key, value);\n } else if (Array.isArray(value)) {\n value.forEach((item) => {\n if (item instanceof File) {\n formData.append(key, item);\n } else if (item !== undefined && item !== null) {\n formData.append(\n key,\n typeof item === \"object\"\n ? JSON.stringify(item)\n : item.toString()\n );\n }\n });\n } else if (value !== undefined && value !== null) {\n formData.append(\n key,\n typeof value === \"object\" ? JSON.stringify(value) : value.toString()\n );\n }\n });\n data = formData;\n delete headers[\"content-type\"];\n }\n }\n return { data, headers };\n};\n"],"names":["useSendPlaygroundRequest","endpoint","baseUrl","contentType","setResult","setIsFetching","inputs","useApiPlaygroundInputs","docsConfig","useContext","DocsConfigContext","disableProxy","_b","_a","useCallback","axios","x","pathWithInputs","addPathParams","url","joinWithSingleSlash","addServerVariables","headers","addContentType","request","response","performDirectRequest","data","performFileRequest","NEXT_PUBLIC","err","path","pathInputs","inputName","inputValue","variables","key","input","name","it","formData","formHeaders","handleFormData","value","item"],"mappings":";;;;AA6BO,MAAMA,IAA2B,CAAC;AAAA,EACvC,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,aAAAC;AAAA,EACA,WAAAC;AAAA,EACA,eAAAC;AACF,MAAqC;;AACnC,QAAMC,IAASC,EAAA,GACT,EAAE,YAAAC,EAAA,IAAeC,EAAWC,CAAiB,GAG7CC,MAAeC,KAAAC,IAAAL,KAAA,gBAAAA,EAAY,QAAZ,gBAAAK,EAAiB,eAAjB,gBAAAD,EAA6B,WAAU;AAE5D,SAAOE,EAAY,YAAY;AAC7B,IAAAT,EAAc,EAAI;AAClB,UAAMU,IAAQ,MAAM,OAAO,OAAO,EAAE,KAAK,CAACC,MAAMA,EAAE,OAAO,G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AAyB;;AAC/C,MAAIG,IAAOH,EAAQ;AAEnB,QAAMF,IAAUE,EAAQ;AAExB,OAAIX,IAAAS,EAAQ,cAAc,MAAtB,QAAAT,EAAyB,SAAS,wBAAwB;AAC5D,UAAM2B,IAAW,IAAI,SAAA;AACrB,IAAI,OAAOb,KAAS,YAAYA,MAAS,SACvC,OAAO,QAAQA,CAAI,EAAE,QAAQ,CAAC,CAACS,GAAKO,CAAK,MAAM;AAC7C,MAAIA,aAAiB,OACnBH,EAAS,OAAOJ,GAAKO,CAAK,IACjB,MAAM,QAAQA,CAAK,IAC5BA,EAAM,QAAQ,CAACC,MAAS;AACtB,QAAIA,aAAgB,OAClBJ,EAAS,OAAOJ,GAAKQ,CAAI,IACMA,KAAS,QACxCJ,EAAS;AAAA,UACPJ;AAAA,UACA,OAAOQ,KAAS,WACZ,KAAK,UAAUA,CAAI,IACnBA,EAAK,SAAA;AAAA,QAAS;AAAA,MAGxB,CAAC,IAC+BD,KAAU,QAC1CH,EAAS;AAAA,QACPJ;AAAA,QACA,OAAOO,KAAU,WAAW,KAAK,UAAUA,CAAK,IAAIA,EAAM,SAAA;AAAA,MAAS;AAAA,IAGzE,CAAC,GACDhB,IAAOa,GACP,OAAOlB,EAAQ,cAAc;AAAA,EAEjC;AACA,SAAO,EAAE,MAAAK,GAAM,SAAAL,EAAA;AACjB;"}
1
+ {"version":3,"file":"useSendPlaygroundRequest.js","sources":["../../src/hooks/useSendPlaygroundRequest.ts"],"sourcesContent":["\nimport { ApiPlaygroundResultType } from \"@mintlify/models\";\nimport { Endpoint, HttpMethod } from \"@mintlify/validation\";\nimport { AxiosResponse } from \"axios\";\nimport { useCallback, useContext } from \"react\";\n\nimport { DocsConfigContext } from \"@/contexts/ConfigContext\";\nimport { NEXT_PUBLIC } from \"@/env\";\n\nimport { useApiPlaygroundInputs } from \"./useMDXContentController/useApiPlaygroundInputs\";\n\nexport type UseSendPlaygroundRequestProps = {\n endpoint: Endpoint;\n baseUrl: string;\n contentType: string;\n setResult: (result: ApiPlaygroundResultType) => void;\n setIsFetching: (isFetching: boolean) => void;\n};\n\nexport type RequestInfo = {\n method: HttpMethod;\n url: string;\n header: Record<string, unknown>;\n query: Record<string, unknown>;\n cookie: Record<string, unknown>;\n body: unknown;\n};\n\nexport const useSendPlaygroundRequest = ({\n endpoint,\n baseUrl,\n contentType,\n setResult,\n setIsFetching,\n}: UseSendPlaygroundRequestProps) => {\n const inputs = useApiPlaygroundInputs();\n const { docsConfig } = useContext(DocsConfigContext);\n\n // TODO: Move to JS pre-processing script\n const disableProxy = docsConfig?.api?.playground?.proxy === false;\n\n return useCallback(async () => {\n setIsFetching(true);\n const axios = await import(\"axios\").then((x) => x.default);\n\n const pathWithInputs = addPathParams(endpoint.path, inputs.path);\n\n const url = joinWithSingleSlash(\n addServerVariables(baseUrl, inputs.server),\n pathWithInputs\n );\n\n const headers = addContentType(inputs.header, contentType);\n\n const request: RequestInfo = {\n method: endpoint.method,\n url,\n header: headers,\n body: inputs.body,\n cookie: inputs.cookie,\n query: inputs.query,\n };\n\n try {\n if (disableProxy) {\n const response = await performDirectRequest(request);\n setResult({\n error: false,\n response: {\n status: response.status,\n statusText: response.statusText,\n headers: response.headers,\n data: response.data,\n },\n });\n } else {\n if (contentType.includes(\"multipart/form-data\")) {\n const data = await performFileRequest(request);\n\n setResult(data);\n } else {\n const { data } = await axios.post<\n unknown,\n AxiosResponse<ApiPlaygroundResultType>\n >(`${NEXT_PUBLIC.BASE_PATH}/_mintlify/api/request`, request);\n\n setResult(data);\n }\n }\n } catch (err) {\n setResult({\n error: true,\n errorMessage: \"unable to complete request\",\n });\n console.error(err);\n }\n setIsFetching(false);\n }, [\n setIsFetching,\n endpoint,\n inputs,\n baseUrl,\n contentType,\n disableProxy,\n setResult,\n ]);\n};\n\nexport const addPathParams = (\n path: string,\n pathInputs: Record<string, unknown>\n) => {\n return Object.entries(pathInputs).reduce((path, [inputName, inputValue]) => {\n if (inputValue == undefined) return path;\n return path.replace(\n `{${inputName}}`,\n encodeURIComponent(inputValue.toString())\n );\n }, path);\n};\n\nexport const addServerVariables = (\n baseUrl: string,\n variables: Record<string, string>\n): string => {\n let url = baseUrl;\n Object.entries(variables).forEach(([key, input]) => {\n if (input) url = url.replace(`{${key}}`, input);\n });\n return url;\n};\n\nexport const joinWithSingleSlash = (baseUrl: string, path: string): string => {\n // remove the last slash of the baseUrl and the first slash of the path, and join with slash\n return baseUrl.replace(/\\/$/, \"\") + \"/\" + path.replace(/^\\//, \"\");\n};\n\nconst addContentType = (\n headers: Record<string, unknown>,\n contentType: string\n) => {\n if (\n Object.keys(headers).some((name) => name.toLowerCase() === \"content-type\")\n ) {\n return headers;\n }\n\n return {\n ...headers,\n [\"content-type\"]: contentType,\n };\n};\n\nconst performDirectRequest = async (request: RequestInfo) => {\n const axios = await import(\"axios\").then((it) => it.default);\n\n const contentType = Object.keys(request.header).find(\n (key) => key.toLowerCase() === \"content-type\"\n );\n let data = request.body;\n \n let headers = request.header as Record<string, string>;\n if (contentType?.includes(\"multipart/form-data\")) {\n const { data: formData, headers: formHeaders } = handleFormData(request);\n data = formData;\n headers = formHeaders;\n }\n\n return axios({\n url: request.url,\n method: request.method,\n params: request.query,\n data,\n headers,\n // prevent axios from adding [] after array query params\n paramsSerializer: {\n indexes: null,\n },\n responseType: \"arraybuffer\",\n // prevent axios from erroring on bad status codes\n validateStatus: () => true,\n // prevent axios from parsing json, losing whitespace information, and using default utf-8 encoding\n // we can't use `responseEncoding` as it's ignored client-side\n transformResponse: (data) => {\n return Buffer.from(data).toString(\"base64\");\n },\n });\n};\n\nconst performFileRequest = async (request: RequestInfo) => {\n const axios = await import(\"axios\").then((it) => it.default);\n const formData = new FormData();\n formData.append(\n \"requestInfo\",\n JSON.stringify({\n method: request.method,\n url: request.url,\n header: request.header,\n query: request.query,\n cookie: request.cookie,\n })\n );\n if (typeof request.body === \"object\" && request.body !== null) {\n Object.entries(request.body).forEach(([key, value]) => {\n if (value instanceof File) {\n formData.append(key, value);\n } else if (Array.isArray(value)) {\n value.forEach((item) => {\n if (item instanceof File) {\n formData.append(key, item);\n } else if (item !== undefined && item !== null) {\n formData.append(\n key,\n typeof item === \"object\" ? JSON.stringify(item) : item.toString()\n );\n }\n });\n } else if (value !== undefined && value !== null) {\n formData.append(\n key,\n typeof value === \"object\" ? JSON.stringify(value) : value.toString()\n );\n }\n });\n }\n\n const { data } = await axios.post<\n unknown,\n AxiosResponse<ApiPlaygroundResultType>\n >(`${NEXT_PUBLIC.BASE_PATH}/_mintlify/api/file-request`, formData);\n return data;\n};\n\nconst handleFormData = (request: RequestInfo) => {\n let data = request.body;\n \n const headers = request.header as Record<string, string>;\n\n if (headers[\"content-type\"]?.includes(\"multipart/form-data\")) {\n const formData = new FormData();\n if (typeof data === \"object\" && data !== null) {\n Object.entries(data).forEach(([key, value]) => {\n if (value instanceof File) {\n formData.append(key, value);\n } else if (Array.isArray(value)) {\n value.forEach((item) => {\n if (item instanceof File) {\n formData.append(key, item);\n } else if (item !== undefined && item !== null) {\n formData.append(\n key,\n typeof item === \"object\"\n ? JSON.stringify(item)\n : item.toString()\n );\n }\n });\n } else if (value !== undefined && value !== null) {\n formData.append(\n key,\n typeof value === \"object\" ? JSON.stringify(value) : value.toString()\n );\n }\n });\n data = formData;\n delete headers[\"content-type\"];\n }\n }\n return { data, headers };\n};\n"],"names":["useSendPlaygroundRequest","endpoint","baseUrl","contentType","setResult","setIsFetching","inputs","useApiPlaygroundInputs","docsConfig","useContext","DocsConfigContext","disableProxy","_b","_a","useCallback","axios","x","pathWithInputs","addPathParams","url","joinWithSingleSlash","addServerVariables","headers","addContentType","request","response","performDirectRequest","data","performFileRequest","NEXT_PUBLIC","err","path","pathInputs","inputName","inputValue","variables","key","input","name","it","formData","formHeaders","handleFormData","value","item"],"mappings":";;;;AA4BO,MAAMA,IAA2B,CAAC;AAAA,EACvC,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,aAAAC;AAAA,EACA,WAAAC;AAAA,EACA,eAAAC;A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ocsLayout>
349
349
  * ```
350
350
  */
351
- export declare const DocsLayout: ({ navTree, children, activeHref, activeId, theme, className, bottomLinks, LinkComponent, localization, telemetry, showSidebar, sidebarClassName, }: DocsLayoutProps) => JSX_2.Element;
351
+ export declare const DocsLayout: ({ navTree, anchors, children, activeHref, activeId, theme, className, bottomLinks, LinkComponent, localization, telemetry, showSidebar, sidebarClassName, }: DocsLayoutProps) => JSX_2.Element;
352
352
 
353
353
  /**
354
354
  * Localization strings for DocsLayout
@@ -364,6 +364,8 @@ export declare interface DocsLayoutLocalization {
364
364
  export declare interface DocsLayoutProps {
365
365
  /** Navigation tree data structure */
366
366
  navTree: NavTreeData;
367
+ /** Anchor configurations */
368
+ anchors?: AnchorConfig[];
367
369
  /** The main content to render in the layout */
368
370
  children: ReactNode;
369
371
  /** Currently active href for navigation highlighting */
@@ -667,7 +669,7 @@ declare interface NavTreeProps {
667
669
  activeId?: string;
668
670
  className?: string;
669
671
  activeHref?: string;
670
- theme?: "light" | "dark" | "system";
672
+ theme?: 'light' | 'dark' | 'system';
671
673
  bottomLinks?: BottomLinkConfig[];
672
674
  anchors?: AnchorConfig[];
673
675
  }