@mintlify/msft-sdk 1.1.62 → 1.1.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api-playground/ApiPlayground/Response/DownloadFileButton.js +6 -5
- package/dist/api-playground/ApiPlayground/Response/ResponseBody/CodeResponseContent.js +13 -12
- package/dist/api-playground/ApiPlayground/Response/ResponsePlaceholder.js +8 -7
- package/dist/api-playground/ApiPlayground/Response/ResponseTable.js +3 -2
- package/dist/api-playground/ApiPlayground/Response/ResponseTopbar.js +9 -8
- package/dist/api-playground/ApiPlayground/Response/index.js +4 -3
- package/dist/api-playground/ApiPlayground/components/AdditionalPropertyButton.js +42 -21
- package/dist/api-playground/ApiPlayground/components/ParamFieldWrapper.js +13 -9
- package/dist/api-playground/ApiPlayground/components/PlaygroundModalWrapper.js +7 -6
- package/dist/api-playground/ApiPlayground/components/SendPill.js +3 -2
- package/dist/api-playground/ApiPlayground/components/TypeDropdown.js +6 -5
- package/dist/api-playground/EndpointFields/ParamFields/ExampleDescription.js +3 -2
- package/dist/api-playground/EndpointFields/components/Description.js +6 -5
- package/dist/api-playground/EndpointFields/components/OptionDropdown.js +9 -8
- package/dist/api-playground/EndpointFields/components/SectionHeading.js +8 -7
- package/dist/api-playground-2/ApiExamples.js +19 -20
- package/dist/api-playground-2/ApiFields.js +20 -247
- package/dist/api-playground-2/EndpointHeader.js +59 -47
- package/dist/api-playground-2/OperationPage.js +70 -67
- package/dist/api-playground-2/Playground.js +67 -83
- package/dist/api-playground-2/SchemaPage.js +22 -9
- package/dist/api-playground-2/components/EndpointFields/Body.js +40 -0
- package/dist/api-playground-2/components/EndpointFields/Parameters.js +90 -0
- package/dist/api-playground-2/components/EndpointFields/Response.js +146 -0
- package/dist/api-playground-2/components/EndpointFields/Security.js +88 -0
- package/dist/api-playground-2/components/EndpointFields/fields/ArrayParamField.js +93 -0
- package/dist/api-playground-2/components/EndpointFields/fields/Enum.js +29 -11
- package/dist/api-playground-2/components/EndpointFields/fields/ObjectParamField.js +145 -0
- package/dist/api-playground-2/components/EndpointFields/fields/PrimitiveParamField.js +60 -48
- package/dist/api-playground-2/components/EndpointFields/fields/SchemaField.js +230 -0
- package/dist/api-playground-2/components/Example/GeneratedRequestExample.js +93 -89
- package/dist/api-playground-2/components/Example/GeneratedResponseExample.js +18 -17
- package/dist/api-playground-2/components/Example/RequestExample.js +92 -93
- package/dist/api-playground-2/components/Example/ResponseExample.js +19 -15
- package/dist/api-playground-2/components/Request/ParameterSection.js +20 -18
- package/dist/api-playground-2/components/Request/SecuritySection.js +53 -43
- package/dist/api-playground-2/components/Request/inputs/ArrayInput.js +89 -40
- package/dist/api-playground-2/components/Request/inputs/DifferentiatedInput.js +12 -12
- package/dist/api-playground-2/components/Request/inputs/FileInput.js +16 -15
- package/dist/api-playground-2/components/Request/inputs/InputContainer.js +76 -57
- package/dist/api-playground-2/components/Request/inputs/NumberInput.js +10 -9
- package/dist/api-playground-2/components/Request/inputs/ObjectInput.js +98 -80
- package/dist/api-playground-2/components/Request/inputs/OneOfInput.js +55 -47
- package/dist/api-playground-2/components/Request/inputs/SelectInput.js +18 -17
- package/dist/api-playground-2/components/Request/inputs/StringInput.js +19 -18
- package/dist/api-playground-2/components/Request/inputs/TextInput.js +12 -11
- package/dist/api-playground-2/components/SendPillWrapper.js +35 -0
- package/dist/api-playground-2/contexts/ApiPlaygroundContext.js +3 -5
- package/dist/api-playground-2/generators/createCookies.js +23 -0
- package/dist/api-playground-2/generators/createHeaders.js +53 -36
- package/dist/api-playground-2/generators/createQueryString.js +30 -0
- package/dist/api-playground-2/generators/generateAuthPlaceholder.js +14 -0
- package/dist/api-playground-2/generators/generateInteractiveCodeSample.js +27 -25
- package/dist/api-playground-2/generators/generateRequest.js +47 -51
- package/dist/api-playground-2/generators/generateResponseExampleMap.js +15 -11
- package/dist/api-playground-2/generators/generateSnippetMap.js +13 -11
- package/dist/api-playground-2/hooks/useCopyPathWithInputs.js +11 -11
- package/dist/api-playground-2/hooks/useInitializeInputs.js +185 -88
- package/dist/api-playground-2/hooks/usePlaygroundInputsStore.js +70 -25
- package/dist/api-playground-2/hooks/useSelectedBaseUrl.js +13 -0
- package/dist/api-playground-2/hooks/useSelectedExample.js +10 -0
- package/dist/api-playground-2/hooks/useSelectedRequestBodyContentType.js +12 -0
- package/dist/api-playground-2/hooks/useSelectedResponseContentType.js +12 -0
- package/dist/api-playground-2/hooks/useSelectedSecurityOption.js +31 -0
- package/dist/api-playground-2/hooks/useSendPlaygroundRequest.js +114 -101
- package/dist/api-playground-2/schemaGraph/addApiReferenceDataFromMdxAndDocsConfig.js +23 -32
- package/dist/api-playground-2/schemaGraph/addTypeLabelsToSchema.js +50 -0
- package/dist/api-playground-2/schemaGraph/addUniqueKeysToSchema.js +40 -24
- package/dist/api-playground-2/schemaGraph/getExampleBodyInputs.js +94 -0
- package/dist/api-playground-2/schemaGraph/getSchemaGraphOperationData.js +56 -50
- package/dist/api-playground-2/schemaGraph/processExamples.js +117 -52
- package/dist/api-playground-2/schemaGraph/processSchema.js +10 -0
- package/dist/api-playground-2/schemaGraph/processSecurityOptions.js +58 -28
- package/dist/api-playground-2/schemaGraph/reduceCompositions.js +220 -181
- package/dist/api-playground-2/schemaGraph/resolveOperationWithDependencies.js +128 -89
- package/dist/api-playground-2/schemaGraph/resolveSchemaWithDependencies.js +15 -16
- package/dist/api-playground-2/schemaGraph/sortSchemaByRequired.js +14 -12
- package/dist/api-playground-2/schemaGraph/utils.js +185 -147
- package/dist/common/guards.js +11 -19
- package/dist/components/Api/Expandable.js +10 -9
- package/dist/components/Api/Param.js +11 -13
- package/dist/components/Api/dropdown-menu.js +10 -9
- package/dist/components/apiPage.js +125 -0
- package/dist/components/content-components/code-group.js +4 -4
- package/dist/components/docsPage.js +54 -56
- package/dist/contexts/EndpointLocationContext.js +3 -3
- package/dist/hooks/useApiParamFieldOption.js +10 -0
- package/dist/hooks/useEndpoint.js +3 -3
- package/dist/hooks/useKeyboardShortcut.js +13 -13
- package/dist/hooks/useSendPlaygroundRequest.js +14 -146
- package/dist/index.d.ts +80 -60
- package/dist/index.js +99 -101
- package/dist/openapi/generateTypeStringFromSchema.js +2 -31
- package/dist/plugins/sanitize/rehype-pre-to-mdx-fence.js +13 -13
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/dist/api-playground/ApiPlayground/Request/BodySection.js +0 -64
- package/dist/api-playground/ApiPlayground/Request/ParameterSection.js +0 -32
- package/dist/api-playground/ApiPlayground/Request/PlaygroundModal.js +0 -201
- package/dist/api-playground/ApiPlayground/Request/SecuritySection.js +0 -146
- package/dist/api-playground/ApiPlayground/Request/ServerSection.js +0 -30
- package/dist/api-playground/ApiPlayground/Request/index.js +0 -43
- package/dist/api-playground/ApiPlayground/Request/inputs/ArrayInput.js +0 -93
- package/dist/api-playground/ApiPlayground/Request/inputs/DifferentiatedInput.js +0 -90
- package/dist/api-playground/ApiPlayground/Request/inputs/FileInput.js +0 -62
- package/dist/api-playground/ApiPlayground/Request/inputs/NullInput.js +0 -33
- package/dist/api-playground/ApiPlayground/Request/inputs/NumberInput.js +0 -61
- package/dist/api-playground/ApiPlayground/Request/inputs/ObjectChildren.js +0 -109
- package/dist/api-playground/ApiPlayground/Request/inputs/ObjectInput.js +0 -87
- package/dist/api-playground/ApiPlayground/Request/inputs/RecursiveInput.js +0 -61
- package/dist/api-playground/ApiPlayground/Request/inputs/SelectInput.js +0 -54
- package/dist/api-playground/ApiPlayground/Request/inputs/StringInput.js +0 -67
- package/dist/api-playground/ApiPlayground/Request/inputs/TextInput.js +0 -44
- package/dist/api-playground/ApiPlayground/components/EndpointsMenu.js +0 -42
- package/dist/api-playground/ApiPlayground/components/EndpointsMenuLink.js +0 -43
- package/dist/api-playground/ApiPlayground/components/EndpointsMenuSearch.js +0 -38
- package/dist/api-playground/ApiPlayground/components/InputContainer.js +0 -128
- package/dist/api-playground/ApiPlayground/components/InputSectionContainer.js +0 -59
- package/dist/api-playground/ApiPlayground/components/PathHeader.js +0 -162
- package/dist/api-playground/ApiPlayground/components/TrashButton.js +0 -26
- package/dist/api-playground/ApiPlayground/index.js +0 -67
- package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/Enum.js +0 -19
- package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/NumberMetadata.js +0 -18
- package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/StringMetadata.js +0 -28
- package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/index.js +0 -5
- package/dist/api-playground/EndpointFields/ParamFields/RecursiveParamField.js +0 -13
- package/dist/api-playground/EndpointFields/index.js +0 -7
- package/dist/api-playground-2/components/EndpointFields/EndpointSecurity.js +0 -87
- package/dist/api-playground-2/components/EndpointFields/fields/SimpleArrayParamField.js +0 -89
- package/dist/api-playground-2/components/EndpointFields/fields/SimpleObjectParamField.js +0 -121
- package/dist/api-playground-2/components/EndpointFields/fields/SimplePrimitiveParamField.js +0 -74
- package/dist/api-playground-2/components/EndpointFields/fields/SimpleSchemaField.js +0 -252
- package/dist/common/potentiallyParseOpenApiString.js +0 -24
- package/dist/common/replaceSlashIndex.js +0 -6
- package/dist/common/slugToTitle.js +0 -10
- package/dist/constants/prism-languages.js +0 -19
- package/dist/contexts/ApiPlaygroundInputsContext.js +0 -17
- package/dist/contexts/MDXContentContext.js +0 -17
- package/dist/hooks/useApiPlaygroundInputs.js +0 -6
- package/dist/hooks/useApiPlaygroundPrefillExamples.js +0 -39
- package/dist/hooks/useBaseUrlOptions.js +0 -18
- package/dist/hooks/useComponentSchemas.js +0 -9
- package/dist/hooks/useGenerateNextAdditionalProperties.js +0 -11
- package/dist/hooks/useGenerateNextItems.js +0 -11
- package/dist/hooks/useGenerateNextProperties.js +0 -11
- package/dist/hooks/useMDXContent.js +0 -6
- package/dist/hooks/useMDXContentController/useApiPlaygroundInputs.js +0 -9
- package/dist/hooks/useMDXContentController/useMDXContentCallbacks/useSetApiBaseIndexCallback.js +0 -15
- package/dist/hooks/useMDXContentController/useMDXContentCallbacks/useSetApiPlaygroundInputsCallback.js +0 -15
- package/dist/hooks/usePlaygroundSchemaOptions.js +0 -42
- package/dist/hooks/usePrefilledInputs/index.js +0 -65
- package/dist/hooks/usePrefilledInputs/storedServerVariables.js +0 -29
- package/dist/hooks/useSecurityOption.js +0 -10
- package/dist/hooks/useSetDefaultValue.js +0 -63
- package/dist/openapi/filterEnums.js +0 -20
- package/dist/openapi/generateNextAdditionalProperties.js +0 -7
- package/dist/openapi/generateNextItems.js +0 -7
- package/dist/openapi/generateNextProperties.js +0 -23
- package/dist/openapi/generateOptionLabels.js +0 -20
- package/dist/openapi/generateSimpleLabels.js +0 -4
- package/dist/openapi/getAuthFilteredSchemaArray.js +0 -18
- package/dist/paths/isEqualIgnoringLeadingSlash.js +0 -21
- package/dist/paths/optionallyRemoveLeadingSlash.js +0 -6
- package/dist/paths/optionallyRemoveTrailingSlash.js +0 -6
- package/dist/utils/api-playground/defaults.js +0 -15
- package/dist/utils/api-playground/paramFieldDefaults.js +0 -10
- package/dist/utils/api-reference/getFilteredSecurityOptions.js +0 -4
- package/dist/utils/api-reference/getNextPropertiesByType.js +0 -5
- package/dist/utils/flattenObject.js +0 -10
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ApiPlaygroundDisplayType } from '@mintlify/models';
|
|
2
1
|
import { ApiPlaygroundInputs } from '@mintlify/validation';
|
|
3
2
|
import { ApiPlaygroundResultType } from '@mintlify/models';
|
|
4
3
|
import { AsyncAPIDocumentInterface } from '@mintlify/common';
|
|
@@ -22,6 +21,7 @@ import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
|
22
21
|
import { MdxExtracts as MdxExtracts_2 } from '@mintlify/common';
|
|
23
22
|
import { MdxJsxFlowElement } from 'mdast-util-mdx-jsx';
|
|
24
23
|
import { MintConfig } from '@mintlify/models';
|
|
24
|
+
import { NamedExoticComponent } from 'react';
|
|
25
25
|
import { Node as Node_2 } from 'unist';
|
|
26
26
|
import { Node as Node_3 } from 'hast';
|
|
27
27
|
import { OpenApiMetadata } from '@mintlify/models';
|
|
@@ -48,6 +48,7 @@ import { StoreApi } from 'zustand';
|
|
|
48
48
|
import { Text as Text_2 } from 'hast';
|
|
49
49
|
import { TrieveType } from '@mintlify/validation';
|
|
50
50
|
import { UseBoundStore } from 'zustand';
|
|
51
|
+
import { UserInfoInputs } from '@mintlify/validation';
|
|
51
52
|
import { UUID } from '@mintlify/validation';
|
|
52
53
|
|
|
53
54
|
export declare const addApiReferenceDataFromMdxAndDocsConfig: ({ pageMetadata, apiReferenceData2, mdxExtracts, docsConfig, }: {
|
|
@@ -82,7 +83,7 @@ export declare interface AnchorConfig {
|
|
|
82
83
|
}
|
|
83
84
|
|
|
84
85
|
export declare const Api: ({ children }: {
|
|
85
|
-
children
|
|
86
|
+
children?: ReactNode | undefined;
|
|
86
87
|
}) => JSX_2.Element | null;
|
|
87
88
|
|
|
88
89
|
export declare const ApiExamples: ({ className, isModal, apiReferenceData, noInputs }: ApiExamplesProps) => JSX_2.Element;
|
|
@@ -94,47 +95,38 @@ declare type ApiExamplesProps = {
|
|
|
94
95
|
noInputs?: boolean;
|
|
95
96
|
};
|
|
96
97
|
|
|
97
|
-
export declare
|
|
98
|
-
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
export declare const ApiPlayground: ({ endpoint, display, pathname }: ApiPlaygroundParams) => JSX_2.Element;
|
|
98
|
+
export declare const ApiFields: NamedExoticComponent< {
|
|
99
|
+
pageMetadata: PageMetaTags;
|
|
100
|
+
}>;
|
|
102
101
|
|
|
103
|
-
export declare
|
|
102
|
+
export declare function ApiPage({ theme, className, pathname, markdownContent, allPages, baseUrl, LinkComponent, contextMenu, apiReferenceData, pageMetadata }: ApiPageProps): JSX_2.Element;
|
|
104
103
|
|
|
105
|
-
|
|
104
|
+
declare interface ApiPageProps {
|
|
105
|
+
theme: 'light' | 'dark';
|
|
106
|
+
className?: string;
|
|
107
|
+
pathname: string;
|
|
108
|
+
markdownContent?: string;
|
|
109
|
+
allPages?: LlmsPageConfig[];
|
|
110
|
+
baseUrl?: string;
|
|
111
|
+
LinkComponent?: LinkComponent;
|
|
112
|
+
contextMenu?: PageContextMenuConfig;
|
|
113
|
+
apiReferenceData?: ApiReferenceDataV2;
|
|
114
|
+
pageMetadata: PageMetaTags;
|
|
115
|
+
}
|
|
106
116
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
isPlaygroundExpanded: boolean;
|
|
111
|
-
result?: ApiPlaygroundResultType;
|
|
112
|
-
selectedBaseUrlIndex: number;
|
|
113
|
-
setSelectedBaseUrlIndex?: (index: number) => void;
|
|
114
|
-
setIsPlaygroundExpanded?: (expanded: boolean) => void;
|
|
115
|
-
baseUrlOptions?: string[];
|
|
116
|
-
selectedExampleIndex?: number;
|
|
117
|
-
setSelectedExampleIndex?: (index: number) => void;
|
|
118
|
-
};
|
|
117
|
+
declare const ApiPlaygroundContext: Context<ApiPlaygroundContextType>;
|
|
118
|
+
export { ApiPlaygroundContext }
|
|
119
|
+
export { ApiPlaygroundContext as ApiPlaygroundContextLegacy }
|
|
119
120
|
|
|
120
|
-
|
|
121
|
+
declare type ApiPlaygroundContextType = {
|
|
121
122
|
isSending?: boolean;
|
|
122
123
|
sendRequest?: () => void;
|
|
123
124
|
isPlaygroundExpanded: boolean;
|
|
124
125
|
result?: ApiPlaygroundResultType;
|
|
125
|
-
selectedBaseUrlIndex: number;
|
|
126
|
-
setSelectedBaseUrlIndex?: (index: number) => void;
|
|
127
126
|
setIsPlaygroundExpanded?: (expanded: boolean) => void;
|
|
128
|
-
baseUrlOptions?: string[];
|
|
129
|
-
selectedExampleIndex?: number;
|
|
130
|
-
setSelectedExampleIndex?: (index: number) => void;
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
declare type ApiPlaygroundParams = {
|
|
134
|
-
endpoint: Endpoint;
|
|
135
|
-
display: ApiPlaygroundDisplayType;
|
|
136
|
-
pathname: string;
|
|
137
127
|
};
|
|
128
|
+
export { ApiPlaygroundContextType }
|
|
129
|
+
export { ApiPlaygroundContextType as ApiPlaygroundContextTypeLegacy }
|
|
138
130
|
|
|
139
131
|
export declare const ApiReferenceContext: Context<ApiReferenceContextType>;
|
|
140
132
|
|
|
@@ -171,8 +163,8 @@ export declare interface ApiReferenceDataV2 {
|
|
|
171
163
|
schemaData?: SchemaV2;
|
|
172
164
|
dependencies?: {
|
|
173
165
|
parameters?: Record<UUID, ParameterObject>;
|
|
174
|
-
requestBody?:
|
|
175
|
-
responses?:
|
|
166
|
+
requestBody?: ResolvedRequestBody;
|
|
167
|
+
responses?: ResolvedResponses;
|
|
176
168
|
servers: Record<UUID, ServerObject>;
|
|
177
169
|
security: Record<UUID, ResolvedSecurityObject>;
|
|
178
170
|
processedSecurityOptions?: ProcessedSecurityOption[];
|
|
@@ -450,7 +442,7 @@ export declare interface DocsLayoutTelemetry {
|
|
|
450
442
|
* />
|
|
451
443
|
* ```
|
|
452
444
|
*/
|
|
453
|
-
export declare function DocsPage({ payload, toc, navTree, activeHref, theme, className, pathname, markdownContent, allPages, baseUrl, bottomLinks, LinkComponent, localization, telemetry, contextMenu,
|
|
445
|
+
export declare function DocsPage({ payload, toc, navTree, activeHref, theme, className, pathname, markdownContent, allPages, baseUrl, bottomLinks, LinkComponent, localization, telemetry, contextMenu, }: DocsPagePropsWithCustomization): JSX_2.Element;
|
|
454
446
|
|
|
455
447
|
/**
|
|
456
448
|
* Localization strings for DocsPage component
|
|
@@ -483,7 +475,6 @@ export declare interface DocsPageProps {
|
|
|
483
475
|
baseUrl?: string;
|
|
484
476
|
bottomLinks?: BottomLinkConfig[];
|
|
485
477
|
LinkComponent?: LinkComponent;
|
|
486
|
-
apiReferenceData2?: any;
|
|
487
478
|
}
|
|
488
479
|
|
|
489
480
|
/**
|
|
@@ -521,16 +512,13 @@ export declare type ElementType = {
|
|
|
521
512
|
tagName?: string;
|
|
522
513
|
};
|
|
523
514
|
|
|
524
|
-
export declare const
|
|
525
|
-
|
|
526
|
-
export declare const EndpointHeader: ({ onCopy, baseUrlOptions, selectedBaseUrlIndex, setSelectedBaseUrlIndex, isCopiedActive, display, path, method, onBaseUrlChange, isInPlaygroundModal, }: EndpointHeaderProps) => JSX_2.Element;
|
|
515
|
+
export declare const EndpointHeader: ({ baseUrl, baseUrlOptions, selectedBaseUrlIndex, setSelectedBaseUrlIndex, display, path, method, onBaseUrlChange, isInPlaygroundModal, }: EndpointHeaderProps) => JSX_2.Element;
|
|
527
516
|
|
|
528
517
|
declare type EndpointHeaderProps = {
|
|
529
|
-
|
|
518
|
+
baseUrl: string;
|
|
530
519
|
baseUrlOptions: string[];
|
|
531
520
|
selectedBaseUrlIndex: number;
|
|
532
521
|
setSelectedBaseUrlIndex: (index: number) => void;
|
|
533
|
-
isCopiedActive: boolean;
|
|
534
522
|
isInPlaygroundModal: boolean;
|
|
535
523
|
display: 'simple' | 'none' | 'interactive';
|
|
536
524
|
path: string;
|
|
@@ -706,7 +694,7 @@ declare interface NavTreeProps {
|
|
|
706
694
|
export declare const OperationPage: ({ apiReferenceData, operation, children, }: {
|
|
707
695
|
apiReferenceData: ApiReferenceDataV2;
|
|
708
696
|
operation: OperationV2;
|
|
709
|
-
children
|
|
697
|
+
children?: ReactNode | undefined;
|
|
710
698
|
}) => JSX_2.Element;
|
|
711
699
|
|
|
712
700
|
export declare type OperationV2 = Operation & {
|
|
@@ -719,13 +707,14 @@ export declare type OperationV2 = Operation & {
|
|
|
719
707
|
requestExamples?: CodeExample[];
|
|
720
708
|
responseExamples?: CodeExample[];
|
|
721
709
|
codeSamples?: CodeSample[];
|
|
722
|
-
requestExampleType?: 'mdx' | 'webhook' | 'codeSamples' | 'generated';
|
|
710
|
+
requestExampleType?: 'mdx' | 'webhook' | 'codeSamples' | 'generated' | 'examples';
|
|
723
711
|
requestExampleLanguages?: string[];
|
|
724
712
|
requiredOnlyExamples?: boolean;
|
|
725
713
|
responseExampleType?: 'mdx' | 'generated';
|
|
726
714
|
prefillPlaygroundWithExample?: boolean;
|
|
727
|
-
prefillPlaygroundExamples?:
|
|
715
|
+
prefillPlaygroundExamples?: Record<string, PlaygroundInputValue>[];
|
|
728
716
|
disableProxy?: boolean;
|
|
717
|
+
userInfoPlaygroundInputs?: UserInfoInputs;
|
|
729
718
|
};
|
|
730
719
|
|
|
731
720
|
export declare const PageContext: Context<PageContextType>;
|
|
@@ -806,17 +795,28 @@ export declare interface PlainTextPageProps {
|
|
|
806
795
|
export declare const Playground: ({ isPlaygroundExpanded, setIsPlaygroundExpanded, baseUrl, baseUrlOptions, apiReferenceData, }: PlaygroundProps) => JSX_2.Element | null;
|
|
807
796
|
|
|
808
797
|
declare interface PlaygroundInputsState {
|
|
798
|
+
apiReferenceData: ApiReferenceDataV2 | undefined;
|
|
809
799
|
inputs: Record<string, PlaygroundInputValue>;
|
|
810
|
-
|
|
800
|
+
initializeInputs: (initialValues: Record<string, PlaygroundInputValue>) => void;
|
|
801
|
+
initializeApiReferenceData: (apiReferenceData: ApiReferenceDataV2) => void;
|
|
811
802
|
setInput: (name: string, value: PlaygroundInputValue) => void;
|
|
812
803
|
setInputs: (inputs: Record<string, PlaygroundInputValue>) => void;
|
|
813
804
|
replaceInputs: (inputs: Record<string, PlaygroundInputValue>) => void;
|
|
805
|
+
deleteInput: (name: string) => void;
|
|
814
806
|
getInput: (name: string) => PlaygroundInputValue;
|
|
815
807
|
getApiPlaygroundInputs: () => ApiPlaygroundInputs;
|
|
816
808
|
clear: () => void;
|
|
817
809
|
reset: () => void;
|
|
810
|
+
selectedBaseUrlIndex: number;
|
|
811
|
+
setSelectedBaseUrlIndex: (index: number) => void;
|
|
818
812
|
selectedSecurityOptionIndex: number;
|
|
819
813
|
setSelectedSecurityOptionIndex: (index: number) => void;
|
|
814
|
+
selectedExampleIndex: number;
|
|
815
|
+
setSelectedExampleIndex: (index: number) => void;
|
|
816
|
+
selectedRequestBodyContentTypeIndex: number;
|
|
817
|
+
setSelectedRequestBodyContentTypeIndex: (index: number) => void;
|
|
818
|
+
selectedResponseContentTypeIndex: number;
|
|
819
|
+
setSelectedResponseContentTypeIndex: (index: number) => void;
|
|
820
820
|
}
|
|
821
821
|
|
|
822
822
|
declare type PlaygroundInputValue = unknown;
|
|
@@ -830,8 +830,15 @@ declare type PlaygroundProps = {
|
|
|
830
830
|
};
|
|
831
831
|
|
|
832
832
|
export declare type ProcessedSecurityOption = {
|
|
833
|
+
schemes: Array<ProcessedSecurityScheme>;
|
|
834
|
+
title: string;
|
|
835
|
+
};
|
|
836
|
+
|
|
837
|
+
declare type ProcessedSecurityScheme = {
|
|
833
838
|
scheme: SecuritySchemeAndScope;
|
|
834
839
|
schema: SchemaObject;
|
|
840
|
+
schemeName: string;
|
|
841
|
+
name: string;
|
|
835
842
|
};
|
|
836
843
|
|
|
837
844
|
export declare const processSecurityOptions: (apiReferenceData: ApiReferenceDataV2) => ProcessedSecurityOption[];
|
|
@@ -860,6 +867,14 @@ export declare function remarkHeadingIds(): (tree: Root) => void;
|
|
|
860
867
|
|
|
861
868
|
export declare function removeHtmlComments(root: Root_2): void;
|
|
862
869
|
|
|
870
|
+
declare type ResolvedRequestBody = RequestBodyObject & {
|
|
871
|
+
exampleType?: 'generated' | 'examples';
|
|
872
|
+
};
|
|
873
|
+
|
|
874
|
+
declare type ResolvedResponses = Record<UUID, ResponseObject & {
|
|
875
|
+
exampleType?: 'generated' | 'examples';
|
|
876
|
+
}>;
|
|
877
|
+
|
|
863
878
|
/**
|
|
864
879
|
* SchemaObject after being processed by the various transformations in `resolveOperationWithDependencies`.
|
|
865
880
|
* This is the type of object that all the API UI components should be consuming. Any properties that
|
|
@@ -882,6 +897,7 @@ export declare type ResolvedSchemaObject = SchemaObject & {
|
|
|
882
897
|
isCircular?: boolean;
|
|
883
898
|
type?: DifferentiatedType;
|
|
884
899
|
[CIRCULAR_REF_KEY]?: UUID;
|
|
900
|
+
typeLabel?: string;
|
|
885
901
|
};
|
|
886
902
|
|
|
887
903
|
export declare type ResolvedSecurityObject = {
|
|
@@ -901,6 +917,8 @@ export declare type SchemaGeneratedExample = {
|
|
|
901
917
|
value: unknown;
|
|
902
918
|
};
|
|
903
919
|
|
|
920
|
+
export { SchemaGraphData }
|
|
921
|
+
|
|
904
922
|
export declare const SchemaPage: ({ apiReferenceData, children, }: {
|
|
905
923
|
apiReferenceData: ApiReferenceDataV2;
|
|
906
924
|
children: ReactNode;
|
|
@@ -991,30 +1009,32 @@ export declare const useCopyPathWithInputs: ({ path, baseUrl }: {
|
|
|
991
1009
|
}) => string;
|
|
992
1010
|
|
|
993
1011
|
/**
|
|
994
|
-
* CLANKED
|
|
995
|
-
*
|
|
1012
|
+
* RE-CLANKED BUT BETTER THIS TIME
|
|
1013
|
+
* Simplified playground initialization hook.
|
|
996
1014
|
*
|
|
997
|
-
*
|
|
998
|
-
*
|
|
999
|
-
* - After reset, it initializes with the new default values for the current endpoint
|
|
1000
|
-
* - When playground closes without pathname change, state is preserved
|
|
1001
|
-
* - Query parameter changes (like ?playground=open) do NOT reset the state
|
|
1015
|
+
* Assumes the Playground component remounts for each new page/endpoint,
|
|
1016
|
+
* so we don't need complex pathname tracking.
|
|
1002
1017
|
*
|
|
1003
|
-
*
|
|
1018
|
+
* Handles:
|
|
1019
|
+
* - Initial mount: Reset and initialize with defaults
|
|
1020
|
+
* - Credentials loading: Update inputs when credentials load from localStorage
|
|
1021
|
+
* - Example switching: Handled via selectedExampleIndex prop changes
|
|
1004
1022
|
*/
|
|
1005
|
-
export declare function useInitializeInputs({ apiReferenceData, selectedBaseUrlIndex, selectedExampleIndex, selectedRequestBodyContentTypeIndex, }:
|
|
1006
|
-
|
|
1007
|
-
export declare function useMarkdownCopy(pathname: string): void;
|
|
1023
|
+
export declare function useInitializeInputs({ apiReferenceData, selectedBaseUrlIndex, selectedExampleIndex, selectedRequestBodyContentTypeIndex, locallyStoredCredentials, serverInputs, }: UseInitializeInputsProps): void;
|
|
1008
1024
|
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
declare interface UsePlaygroundStateSyncProps {
|
|
1025
|
+
declare interface UseInitializeInputsProps {
|
|
1012
1026
|
apiReferenceData: ApiReferenceDataV2;
|
|
1013
1027
|
selectedBaseUrlIndex: number;
|
|
1014
1028
|
selectedExampleIndex: number;
|
|
1015
1029
|
selectedRequestBodyContentTypeIndex: number;
|
|
1030
|
+
locallyStoredCredentials: Record<string, any> | undefined;
|
|
1031
|
+
serverInputs: Record<string, string> | undefined;
|
|
1016
1032
|
}
|
|
1017
1033
|
|
|
1034
|
+
export declare function useMarkdownCopy(pathname: string): void;
|
|
1035
|
+
|
|
1036
|
+
export declare const usePlaygroundInputsStore: UseBoundStore<StoreApi<PlaygroundInputsState>>;
|
|
1037
|
+
|
|
1018
1038
|
export declare const useSelectedSecurityOption: () => {
|
|
1019
1039
|
selectedSecurityOptionIndex: number;
|
|
1020
1040
|
setSelectedSecurityOptionIndex: (index: number) => void;
|
package/dist/index.js
CHANGED
|
@@ -3,14 +3,14 @@ import { DocsLayout as p } from "./components/docsLayout.js";
|
|
|
3
3
|
import { MDXRenderer as a } from "./components/mdx-renderer.js";
|
|
4
4
|
import { PlainTextPage as n } from "./components/plain-text-page.js";
|
|
5
5
|
import { createDefaultComponents as l, defaultComponents as i } from "./components/content-components/default-components.js";
|
|
6
|
-
import { ComponentsProvider as
|
|
6
|
+
import { ComponentsProvider as d, useComponents as C } from "./context/components-context.js";
|
|
7
7
|
import { NavTree as P } from "./components/nav-tree/index.js";
|
|
8
|
-
import { useApiReference as
|
|
8
|
+
import { useApiReference as u } from "./components/Api/ApiReferenceProvider.js";
|
|
9
9
|
import { ApiReferenceContext as T, ApiReferenceContext2 as b, ApiReferenceProvider as v, ApiReferenceProvider2 as A, DeploymentMetadataContext as H, DeploymentMetadataProvider as h, DocsConfigContext as D, DocsConfigProvider as R, PageContext as M, PageProvider as k } from "./contexts/ConfigContext.js";
|
|
10
10
|
import { TableOfContents as w } from "./components/toc/index.js";
|
|
11
|
-
import { PivotAwareTOC as
|
|
11
|
+
import { PivotAwareTOC as F } from "./components/toc/pivot-aware-toc.js";
|
|
12
12
|
import { PageContextMenu as N } from "./components/page-context-menu.js";
|
|
13
|
-
import { copyMarkdownToClipboard as
|
|
13
|
+
import { copyMarkdownToClipboard as Z, getPageMarkdown as z, useMarkdownCopy as E } from "./hooks/useMarkdownCopy.js";
|
|
14
14
|
import { generateLlmsFullTxt as X, generateLlmsTxt as q } from "./utils/generate-llms-txt.js";
|
|
15
15
|
import { getNodeText as J } from "./utils/get-node-text.js";
|
|
16
16
|
import { capitalize as j } from "./utils/string.js";
|
|
@@ -22,150 +22,148 @@ import { serializeMdx as pe } from "./parser/serialize-mdx.js";
|
|
|
22
22
|
import { extractHeadings as ae } from "./plugins/extract-headings.js";
|
|
23
23
|
import { rehypeRemoveHtmlComments as ne, removeHtmlComments as fe } from "./plugins/sanitize/remove-html-comments.js";
|
|
24
24
|
import { Api as ie } from "./api-playground-2/Api.js";
|
|
25
|
-
import { OperationPage as
|
|
25
|
+
import { OperationPage as de } from "./api-playground-2/OperationPage.js";
|
|
26
26
|
import { SchemaPage as ge } from "./api-playground-2/SchemaPage.js";
|
|
27
|
-
import { ApiExamples as
|
|
27
|
+
import { ApiExamples as ce } from "./api-playground-2/ApiExamples.js";
|
|
28
28
|
import { ApiFields as ye } from "./api-playground-2/ApiFields.js";
|
|
29
29
|
import { Playground as be } from "./api-playground-2/Playground.js";
|
|
30
30
|
import { EndpointHeader as Ae } from "./api-playground-2/EndpointHeader.js";
|
|
31
|
-
import { ApiPlaygroundContext as he } from "./api-playground-2/contexts/ApiPlaygroundContext.js";
|
|
32
|
-
import { usePlaygroundInputsStore as
|
|
31
|
+
import { ApiPlaygroundContext as he, ApiPlaygroundContext as De } from "./api-playground-2/contexts/ApiPlaygroundContext.js";
|
|
32
|
+
import { usePlaygroundInputsStore as Me } from "./api-playground-2/hooks/usePlaygroundInputsStore.js";
|
|
33
33
|
import { useSendPlaygroundRequest as Se } from "./api-playground-2/hooks/useSendPlaygroundRequest.js";
|
|
34
|
-
import { useInitializeInputs as
|
|
34
|
+
import { useInitializeInputs as Le } from "./api-playground-2/hooks/useInitializeInputs.js";
|
|
35
35
|
import { useCopyPathWithInputs as Ie } from "./api-playground-2/hooks/useCopyPathWithInputs.js";
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import { tableCellHandler as ar, tableHandler as xr, tableRowHandler as nr } from "./plugins/sanitize/rehype-table-align.js";
|
|
36
|
+
import { useSelectedSecurityOption as Oe } from "./api-playground-2/hooks/useSelectedSecurityOption.js";
|
|
37
|
+
import { addApiReferenceDataFromMdxAndDocsConfig as ze } from "./api-playground-2/schemaGraph/addApiReferenceDataFromMdxAndDocsConfig.js";
|
|
38
|
+
import { processSecurityOptions as Be } from "./api-playground-2/schemaGraph/processSecurityOptions.js";
|
|
39
|
+
import { getApiReferenceDataFromGraph as qe } from "./api-playground-2/schemaGraph/getApiReferenceDataFromGraph.js";
|
|
40
|
+
import { ApiPage as Je } from "./components/apiPage.js";
|
|
41
|
+
import { CodeBlock as je } from "./components/content-components/code-block.js";
|
|
42
|
+
import { Heading as Qe } from "./components/content-components/heading.js";
|
|
43
|
+
import { Link as Ve } from "./components/content-components/link.js";
|
|
44
|
+
import { Callout as _e } from "./components/content-components/callouts.js";
|
|
45
|
+
import { ZonePivot as eo } from "./components/content-components/zone-pivots/zone-pivot.js";
|
|
46
|
+
import { ZoneTarget as ro } from "./components/content-components/zone-pivots/zone-target.js";
|
|
47
|
+
import { ZonePivotProvider as po } from "./components/content-components/zone-pivots/zone-pivot-context.js";
|
|
48
|
+
import { ZonePivotSelector as ao } from "./components/content-components/zone-pivots/zone-pivot-selector.js";
|
|
49
|
+
import { ParamName as no } from "./components/content-components/param-name.js";
|
|
50
|
+
import { Tabs as lo } from "./components/content-components/tabs/tabs.js";
|
|
51
|
+
import { Tab as so } from "./components/content-components/tabs/tab.js";
|
|
52
|
+
import { Details as go, Summary as Po } from "./components/content-components/details/details.js";
|
|
53
|
+
import { Table as uo, TableBody as yo, TableCaption as To, TableCell as bo, TableFooter as vo, TableHead as Ao, TableHeader as Ho, TableRow as ho } from "./components/content-components/table/index.js";
|
|
54
|
+
import { LaTeX as Ro } from "./components/content-components/latex.js";
|
|
55
|
+
import { allComponents as ko } from "./components/content-components/all-components.js";
|
|
56
|
+
import { Home as wo } from "./components/content-components/home.js";
|
|
57
|
+
import { MobileNavTree as Fo } from "./components/nav-tree/mobile-nav.js";
|
|
58
|
+
import { rehypeCodeblocks as No } from "./plugins/rehype/rehype-code-blocks.js";
|
|
59
|
+
import { remarkHeadingIds as Zo } from "./plugins/remark/remark-heading-ids.js";
|
|
60
|
+
import { sanitizePreTags as Eo } from "./plugins/sanitize/rehype-pre-to-mdx-fence.js";
|
|
61
|
+
import { rehypeCallouts as Xo } from "./plugins/sanitize/rehype-callouts.js";
|
|
62
|
+
import { rehypeParamName as Go } from "./plugins/sanitize/rehype-param-name.js";
|
|
63
|
+
import { rehypeTabs as Wo } from "./plugins/sanitize/rehype-tabs.js";
|
|
64
|
+
import { rehypeDetails as Ko } from "./plugins/sanitize/rehype-details.js";
|
|
65
|
+
import { rehypeHeadingIds as Uo } from "./plugins/sanitize/rehype-heading-ids.js";
|
|
66
|
+
import { rehypeZonePivots as Yo } from "./plugins/sanitize/rehype-zone-pivots.js";
|
|
67
|
+
import { mdxJsxFlowElementHandler as $o, rehypeRemark as er } from "./plugins/sanitize/rehype-remark.js";
|
|
68
|
+
import { rehypeLatex as rr } from "./plugins/sanitize/rehype-latex.js";
|
|
69
|
+
import { tableCellHandler as pr, tableHandler as mr, tableRowHandler as ar } from "./plugins/sanitize/rehype-table-align.js";
|
|
71
70
|
export {
|
|
72
71
|
ie as Api,
|
|
73
|
-
|
|
72
|
+
ce as ApiExamples,
|
|
74
73
|
ye as ApiFields,
|
|
75
|
-
|
|
74
|
+
Je as ApiPage,
|
|
76
75
|
he as ApiPlaygroundContext,
|
|
77
|
-
|
|
76
|
+
De as ApiPlaygroundContextLegacy,
|
|
78
77
|
T as ApiReferenceContext,
|
|
79
78
|
b as ApiReferenceContext2,
|
|
80
79
|
v as ApiReferenceProvider,
|
|
81
80
|
A as ApiReferenceProvider2,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
81
|
+
_e as Callout,
|
|
82
|
+
je as CodeBlock,
|
|
83
|
+
d as ComponentsProvider,
|
|
85
84
|
H as DeploymentMetadataContext,
|
|
86
85
|
h as DeploymentMetadataProvider,
|
|
87
|
-
|
|
86
|
+
go as Details,
|
|
88
87
|
D as DocsConfigContext,
|
|
89
88
|
R as DocsConfigProvider,
|
|
90
89
|
p as DocsLayout,
|
|
91
90
|
r as DocsPage,
|
|
92
|
-
je as EndpointFields,
|
|
93
91
|
Ae as EndpointHeader,
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
92
|
+
Qe as Heading,
|
|
93
|
+
wo as Home,
|
|
94
|
+
Ro as LaTeX,
|
|
95
|
+
Ve as Link,
|
|
98
96
|
a as MDXRenderer,
|
|
99
|
-
|
|
97
|
+
Fo as MobileNavTree,
|
|
100
98
|
P as NavTree,
|
|
101
|
-
|
|
99
|
+
de as OperationPage,
|
|
102
100
|
M as PageContext,
|
|
103
101
|
N as PageContextMenu,
|
|
104
102
|
k as PageProvider,
|
|
105
|
-
|
|
106
|
-
|
|
103
|
+
no as ParamName,
|
|
104
|
+
F as PivotAwareTOC,
|
|
107
105
|
n as PlainTextPage,
|
|
108
106
|
be as Playground,
|
|
109
107
|
ge as SchemaPage,
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
108
|
+
Po as Summary,
|
|
109
|
+
so as Tab,
|
|
110
|
+
uo as Table,
|
|
111
|
+
yo as TableBody,
|
|
112
|
+
To as TableCaption,
|
|
113
|
+
bo as TableCell,
|
|
114
|
+
vo as TableFooter,
|
|
115
|
+
Ao as TableHead,
|
|
116
|
+
Ho as TableHeader,
|
|
119
117
|
w as TableOfContents,
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
118
|
+
ho as TableRow,
|
|
119
|
+
lo as Tabs,
|
|
120
|
+
eo as ZonePivot,
|
|
121
|
+
po as ZonePivotProvider,
|
|
122
|
+
ao as ZonePivotSelector,
|
|
123
|
+
ro as ZoneTarget,
|
|
124
|
+
ze as addApiReferenceDataFromMdxAndDocsConfig,
|
|
125
|
+
ko as allComponents,
|
|
128
126
|
j as capitalize,
|
|
129
127
|
V as cleanTitle,
|
|
130
128
|
Q as cn,
|
|
131
129
|
re as convertHtmlToMdx,
|
|
132
|
-
|
|
130
|
+
Z as copyMarkdownToClipboard,
|
|
133
131
|
l as createDefaultComponents,
|
|
134
132
|
i as defaultComponents,
|
|
135
133
|
ae as extractHeadings,
|
|
136
134
|
X as generateLlmsFullTxt,
|
|
137
135
|
q as generateLlmsTxt,
|
|
138
|
-
|
|
136
|
+
qe as getApiReferenceDataFromGraph,
|
|
139
137
|
_ as getClassNames,
|
|
140
138
|
J as getNodeText,
|
|
141
|
-
|
|
139
|
+
z as getPageMarkdown,
|
|
142
140
|
$ as getTextContent,
|
|
143
141
|
ee as isElement,
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
142
|
+
$o as mdxJsxFlowElementHandler,
|
|
143
|
+
Be as processSecurityOptions,
|
|
144
|
+
Xo as rehypeCallouts,
|
|
145
|
+
No as rehypeCodeblocks,
|
|
146
|
+
Ko as rehypeDetails,
|
|
147
|
+
Uo as rehypeHeadingIds,
|
|
148
|
+
rr as rehypeLatex,
|
|
149
|
+
Go as rehypeParamName,
|
|
150
|
+
er as rehypeRemark,
|
|
153
151
|
ne as rehypeRemoveHtmlComments,
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
152
|
+
Wo as rehypeTabs,
|
|
153
|
+
Yo as rehypeZonePivots,
|
|
154
|
+
Zo as remarkHeadingIds,
|
|
157
155
|
fe as removeHtmlComments,
|
|
158
|
-
|
|
156
|
+
Eo as sanitizePreTags,
|
|
159
157
|
pe as serializeMdx,
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
158
|
+
pr as tableCellHandler,
|
|
159
|
+
mr as tableHandler,
|
|
160
|
+
ar as tableRowHandler,
|
|
161
|
+
u as useApiReference,
|
|
164
162
|
C as useComponents,
|
|
165
163
|
Ie as useCopyPathWithInputs,
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
164
|
+
Le as useInitializeInputs,
|
|
165
|
+
E as useMarkdownCopy,
|
|
166
|
+
Me as usePlaygroundInputsStore,
|
|
167
|
+
Oe as useSelectedSecurityOption,
|
|
170
168
|
Se as useSendPlaygroundRequest
|
|
171
169
|
};
|
|
@@ -1,33 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { getAuthFilteredSchemaArray as p } from "./getAuthFilteredSchemaArray.js";
|
|
3
|
-
const g = 5, s = " | null", b = (t, a, $, l, o = 0) => {
|
|
4
|
-
let u = !1;
|
|
5
|
-
const r = $ ? s : "";
|
|
6
|
-
switch (t.type) {
|
|
7
|
-
case "any":
|
|
8
|
-
return "any";
|
|
9
|
-
case "null":
|
|
10
|
-
return "null";
|
|
11
|
-
case "object":
|
|
12
|
-
return t.title ? `${t.title} · object` : "object";
|
|
13
|
-
case "array":
|
|
14
|
-
let i = c(t, a, void 0);
|
|
15
|
-
const y = p({ schemaArray: i, userGroups: l });
|
|
16
|
-
if (y && (i = y), i.some((n) => n.type === "array") && o >= g)
|
|
17
|
-
return u = !0, `array${r}`;
|
|
18
|
-
const f = /* @__PURE__ */ new Set();
|
|
19
|
-
i.forEach(
|
|
20
|
-
(n) => f.add(
|
|
21
|
-
b(n, a, !1, l, o + 1)
|
|
22
|
-
)
|
|
23
|
-
);
|
|
24
|
-
const e = Array.from(f);
|
|
25
|
-
return u ? `array${r}` : e.length === 1 && e[0] === "object" && t.title ? `${t.title} · object[]${r}` : e.length === 1 ? `${e[0]}[]${r}` : e.length > 1 && t.title ? `${t.title} · array` : e.every((n) => n !== "object" && n !== "array") ? `(${e.join(" | ")})[]${r}` : `array${r}`;
|
|
26
|
-
default:
|
|
27
|
-
return `${"format" in t && typeof t.format == "string" ? `${t.type}<${t.format}>` : t.type}${r}`;
|
|
28
|
-
}
|
|
29
|
-
};
|
|
1
|
+
const l = " | null";
|
|
30
2
|
export {
|
|
31
|
-
|
|
32
|
-
s as orNullTypeString
|
|
3
|
+
l as orNullTypeString
|
|
33
4
|
};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { visit as
|
|
1
|
+
import { visit as n } from "unist-util-visit";
|
|
2
2
|
import { isElement as t } from "../../utils/rehype.js";
|
|
3
|
-
const c = () => (
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
if (!t(
|
|
3
|
+
const c = () => (p) => {
|
|
4
|
+
n(p, (a) => {
|
|
5
|
+
var o;
|
|
6
|
+
if (!t(a) || !t(a, "tagName", "pre"))
|
|
7
7
|
return;
|
|
8
|
-
const e =
|
|
8
|
+
const e = a.children[0];
|
|
9
9
|
if (!e || !t(e, "tagName", "code"))
|
|
10
10
|
return;
|
|
11
|
-
const
|
|
12
|
-
if (Array.isArray(
|
|
13
|
-
for (const r of
|
|
11
|
+
const i = (o = e.properties) == null ? void 0 : o.className;
|
|
12
|
+
if (Array.isArray(i)) {
|
|
13
|
+
for (const r of i)
|
|
14
14
|
if (typeof r == "string" && r.startsWith("lang-")) {
|
|
15
|
-
const
|
|
16
|
-
e.properties || (e.properties = {}), e.properties.className = [`language-${
|
|
15
|
+
const s = r.replace(/^lang-/, "");
|
|
16
|
+
e.properties || (e.properties = {}), e.properties.className = [`language-${s}`];
|
|
17
17
|
break;
|
|
18
18
|
} else if (typeof r == "string" && r.startsWith("language-")) {
|
|
19
|
-
const
|
|
20
|
-
e.properties || (e.properties = {}), e.properties.className = [`language-${
|
|
19
|
+
const s = r.replace(/^language-/, "");
|
|
20
|
+
e.properties || (e.properties = {}), e.properties.className = [`language-${s}`];
|
|
21
21
|
break;
|
|
22
22
|
}
|
|
23
23
|
}
|