@mintlify/common 1.0.398 → 1.0.400
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/divisions/generatePathToLanguageDict.js +6 -0
- package/dist/divisions/generatePathToVersionDict.js +3 -0
- package/dist/divisions/generatePathToVersionDictForDocsConfig.js +6 -0
- package/dist/mdx/lib/remark-utils.d.ts +8 -8
- package/dist/mdx/lib/remark-utils.js +23 -25
- package/dist/mdx/plugins/rehype/rehypeCodeBlocks.js +1 -2
- package/dist/mdx/plugins/rehype/rehypeMdxExtractEndpoint/parsers.d.ts +1 -1
- package/dist/mdx/plugins/rehype/rehypeMdxExtractEndpoint/parsers.js +10 -4
- package/dist/mdx/plugins/rehype/rehypeRawComponents.d.ts +2 -1
- package/dist/mdx/plugins/rehype/rehypeRawComponents.js +6 -3
- package/dist/mdx/plugins/rehype/rehypeUnicodeIds.d.ts +2 -1
- package/dist/mdx/plugins/rehype/rehypeUnicodeIds.js +9 -7
- package/dist/mdx/plugins/remark/remarkExtractChangelogFilters.d.ts +3 -1
- package/dist/mdx/plugins/remark/remarkExtractChangelogFilters.js +29 -32
- package/dist/mdx/plugins/remark/remarkExtractTableOfContents.d.ts +3 -1
- package/dist/mdx/plugins/remark/remarkExtractTableOfContents.js +71 -55
- package/dist/mdx/plugins/remark/remarkFrames.d.ts +2 -1
- package/dist/mdx/plugins/remark/remarkFrames.js +0 -27
- package/dist/mdx/plugins/remark/remarkHeadingIds.d.ts +2 -1
- package/dist/mdx/plugins/remark/remarkHeadingIds.js +4 -3
- package/dist/mdx/snippets/resolveImport/index.js +5 -1
- package/dist/navigation/getAllPathsInDocsNav.js +6 -0
- package/dist/navigation/getFirstPageFromNavigation.js +7 -0
- package/dist/openapi/parseOpenApiString.js +4 -2
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +4 -4
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { OpenAPIV3 } from 'openapi-types';
|
|
2
|
+
const VALID_METHODS = Object.values(OpenAPIV3.HttpMethods).concat('webhook');
|
|
1
3
|
/**
|
|
2
4
|
*
|
|
3
5
|
* @param str either the openapi or api string defined in the frontmatter
|
|
@@ -27,7 +29,7 @@ export const potentiallyParseOpenApiString = (str) => {
|
|
|
27
29
|
}
|
|
28
30
|
if (method) {
|
|
29
31
|
method = method.toLowerCase();
|
|
30
|
-
if (!
|
|
32
|
+
if (!VALID_METHODS.includes(method)) {
|
|
31
33
|
// invalid http method
|
|
32
34
|
return undefined;
|
|
33
35
|
}
|
|
@@ -63,7 +65,7 @@ export const parseOpenApiString = (str) => {
|
|
|
63
65
|
throw new Error('improperly formatted openapi string');
|
|
64
66
|
}
|
|
65
67
|
method = method.toLowerCase();
|
|
66
|
-
if (!
|
|
68
|
+
if (!VALID_METHODS.includes(method)) {
|
|
67
69
|
throw new Error('invalid http method');
|
|
68
70
|
}
|
|
69
71
|
return {
|