docs-util: rename docblock-generator to docs-generator (#8331)

* docs-util: rename docblock-generator to docs-generator

* change program name

* fix action
This commit is contained in:
Shahed Nasser
2024-07-29 16:04:33 +03:00
committed by GitHub
parent 7ad4e7b1c9
commit ebaf0eb53a
51 changed files with 40 additions and 19 deletions
@@ -0,0 +1,35 @@
import { OpenAPIV3 } from "openapi-types"
export const DOCBLOCK_LINE_ASTRIX = " * "
export const DOCBLOCK_NEW_LINE = `\n${DOCBLOCK_LINE_ASTRIX}`
export const DOCBLOCK_START = `*${DOCBLOCK_NEW_LINE}`
export const DOCBLOCK_END_LINE = "\n"
export const DOCBLOCK_DOUBLE_LINES = `${DOCBLOCK_NEW_LINE}${DOCBLOCK_NEW_LINE}`
export const DEFAULT_OAS_RESPONSES: {
[k: string]: OpenAPIV3.ReferenceObject
} = {
"400": {
$ref: "#/components/responses/400_error",
},
"401": {
$ref: "#/components/responses/unauthorized",
},
"404": {
$ref: "#/components/responses/not_found_error",
},
"409": {
$ref: "#/components/responses/invalid_state_error",
},
"422": {
$ref: "#/components/responses/invalid_request_error",
},
"500": {
$ref: "#/components/responses/500_error",
},
}
export const API_ROUTE_PARAM_REGEX = /\[(.+?)\]/g
// we can't use `{summary}` because it causes an MDX error
// when we finally render the summary. We can alternatively
// use `\{summary\}` but it wouldn't look pretty in the OAS,
// so doing this for now.
export const SUMMARY_PLACEHOLDER = "SUMMARY"