From a71d26fabf3331ba824b6a3da87b2d308646c029 Mon Sep 17 00:00:00 2001 From: Aramis Sennyey Date: Wed, 22 Feb 2023 18:32:53 -0500 Subject: [PATCH] Create + update API report. Signed-off-by: Aramis Sennyey --- plugins/openapi-router-common/api-report.md | 331 ++++++++++++++++++ plugins/openapi-router-common/src/index.ts | 3 +- plugins/openapi-router-common/src/router.ts | 12 +- .../openapi-router-common/src/types/common.ts | 88 ++++- .../src/types/express.ts | 22 +- .../openapi-router-common/src/types/index.ts | 2 + .../src/types/requests.ts | 12 +- .../src/types/{response.ts => responses.ts} | 20 +- 8 files changed, 467 insertions(+), 23 deletions(-) create mode 100644 plugins/openapi-router-common/api-report.md rename plugins/openapi-router-common/src/types/{response.ts => responses.ts} (92%) diff --git a/plugins/openapi-router-common/api-report.md b/plugins/openapi-router-common/api-report.md new file mode 100644 index 0000000000..6dbe59dc06 --- /dev/null +++ b/plugins/openapi-router-common/api-report.md @@ -0,0 +1,331 @@ +## API Report File for "@backstage/plugin-openapi-router" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts +import type { ContentObject } from 'openapi3-ts'; +import core from 'express-serve-static-core'; +import { FromSchema } from 'json-schema-to-ts'; +import { JSONSchema7 } from 'json-schema-to-ts'; +import type { OpenAPIObject } from 'openapi3-ts'; +import type { ReferenceObject } from 'openapi3-ts'; +import type { RequestBodyObject } from 'openapi3-ts'; +import type { ResponseObject } from 'openapi3-ts'; +import { Router } from 'express'; + +// @public +export interface ApiRouter extends Router { + // (undocumented) + all: DocRequestMatcher; + // (undocumented) + delete: DocRequestMatcher; + // (undocumented) + get: DocRequestMatcher; + // (undocumented) + head: DocRequestMatcher; + // (undocumented) + options: DocRequestMatcher; + // (undocumented) + patch: DocRequestMatcher; + // (undocumented) + post: DocRequestMatcher; + // (undocumented) + put: DocRequestMatcher; +} + +// @public (undocumented) +export type ComponentRef< + Doc extends RequiredDoc, + Type extends ComponentTypes, + Ref extends ReferenceObject, +> = Ref extends { + $ref: `#/components/${Type}/${infer Name}`; +} + ? Name extends keyof Doc['components'][Type] + ? Doc['components'][Type][Name] extends ReferenceObject + ? ComponentRef + : Doc['components'][Type][Name] + : never + : never; + +// @public (undocumented) +export type ComponentTypes = Extract< + keyof Doc['components'], + string +>; + +// @public (undocumented) +export type ConvertAll = []> = T extends [ + infer First extends JSONSchema7, + ...infer Rest, +] + ? ConvertAll]> + : R; + +// @public (undocumented) +export type DocOperation< + Doc extends RequiredDoc, + Path extends keyof Doc['paths'], + Method extends keyof Doc['paths'][Path], +> = Doc['paths'][Path][Method]; + +// @public +export type DocPath< + Doc extends PathDoc, + Path extends PathTemplate>, +> = ValueOf<{ + [Template in Extract< + keyof Doc['paths'], + string + >]: Path extends PathTemplate