@backstage/backend-openapi-utils 0.1.7 → 0.1.8

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @backstage/backend-openapi-utils
2
2
 
3
+ ## 0.1.8
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @backstage/backend-plugin-api@0.6.15
9
+ - @backstage/errors@1.2.4
10
+
3
11
  ## 0.1.7
4
12
 
5
13
  ### Patch Changes
package/dist/index.cjs.js CHANGED
@@ -1,16 +1,14 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  var PromiseRouter = require('express-promise-router');
6
4
  var express = require('express');
7
5
  var errors = require('@backstage/errors');
8
6
  var expressOpenapiValidator = require('express-openapi-validator');
9
7
  var openapiMerge = require('openapi-merge');
10
8
 
11
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
9
+ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
12
10
 
13
- var PromiseRouter__default = /*#__PURE__*/_interopDefaultLegacy(PromiseRouter);
11
+ var PromiseRouter__default = /*#__PURE__*/_interopDefaultCompat(PromiseRouter);
14
12
 
15
13
  var index = /*#__PURE__*/Object.freeze({
16
14
  __proto__: null
@@ -32,7 +30,7 @@ function getOpenApiSpecRoute(baseUrl) {
32
30
  return `${baseUrl}${OPENAPI_SPEC_ROUTE}`;
33
31
  }
34
32
  function createValidatedOpenApiRouter(spec, options) {
35
- const router = PromiseRouter__default["default"]();
33
+ const router = PromiseRouter__default.default();
36
34
  router.use((options == null ? void 0 : options.middleware) || getDefaultRouterMiddleware());
37
35
  router.use((req, _, next) => {
38
36
  const customRequest = req;
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../src/constants.ts","../src/stub.ts","../src/testUtils.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * The route that all OpenAPI specs should be served from.\n * @public\n */\nexport const OPENAPI_SPEC_ROUTE = '/openapi.json';\n","/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport PromiseRouter from 'express-promise-router';\nimport { ApiRouter } from './router';\nimport { RequiredDoc } from './types';\nimport {\n ErrorRequestHandler,\n RequestHandler,\n NextFunction,\n Request,\n Response,\n json,\n} from 'express';\nimport { InputError } from '@backstage/errors';\nimport { middleware as OpenApiValidator } from 'express-openapi-validator';\nimport { OPENAPI_SPEC_ROUTE } from './constants';\nimport { isErrorResult, merge } from 'openapi-merge';\n\ntype PropertyOverrideRequest = Request & {\n [key: symbol]: string;\n};\n\nconst baseUrlSymbol = Symbol();\nconst originalUrlSymbol = Symbol();\n\nfunction validatorErrorTransformer(): ErrorRequestHandler {\n return (error: Error, _: Request, _2: Response, next: NextFunction) => {\n next(new InputError(error.message));\n };\n}\n\nexport function getDefaultRouterMiddleware() {\n return [json()];\n}\n\n/**\n * Given a base url for a plugin, find the given OpenAPI spec for that plugin.\n * @param baseUrl - Plugin base url.\n * @returns OpenAPI spec route for the base url.\n * @public\n */\nexport function getOpenApiSpecRoute(baseUrl: string) {\n return `${baseUrl}${OPENAPI_SPEC_ROUTE}`;\n}\n\n/**\n * Create a new OpenAPI router with some default middleware.\n * @param spec - Your OpenAPI spec imported as a JSON object.\n * @param validatorOptions - `openapi-express-validator` options to override the defaults.\n * @returns A new express router with validation middleware.\n * @public\n */\nexport function createValidatedOpenApiRouter<T extends RequiredDoc>(\n spec: T,\n options?: {\n validatorOptions?: Partial<Parameters<typeof OpenApiValidator>['0']>;\n middleware?: RequestHandler[];\n },\n) {\n const router = PromiseRouter();\n router.use(options?.middleware || getDefaultRouterMiddleware());\n\n /**\n * Middleware to setup the routing for OpenApiValidator. OpenApiValidator expects `req.originalUrl`\n * and `req.baseUrl` to be the full path. We adjust them here to basically be nothing and then\n * revive the old values in the last function in this method. We could instead update `req.path`\n * but that might affect the routing and I'd rather not.\n *\n * TODO: I opened https://github.com/cdimascio/express-openapi-validator/issues/843\n * to track this on the middleware side, but there was a similar ticket, https://github.com/cdimascio/express-openapi-validator/issues/113\n * that has had minimal activity. If that changes, update this to use a new option on their side.\n */\n router.use((req: Request, _, next) => {\n /**\n * Express typings are weird. They don't recognize PropertyOverrideRequest as a valid\n * Request child and try to overload as PathParams. Just cast it here, since we know\n * what we're doing.\n */\n const customRequest = req as PropertyOverrideRequest;\n customRequest[baseUrlSymbol] = customRequest.baseUrl;\n customRequest.baseUrl = '';\n customRequest[originalUrlSymbol] = customRequest.originalUrl;\n customRequest.originalUrl = customRequest.url;\n next();\n });\n\n // TODO: Handle errors by converting from OpenApiValidator errors to known @backstage/errors errors.\n router.use(\n OpenApiValidator({\n validateRequests: {\n coerceTypes: false,\n allowUnknownQueryParameters: false,\n },\n ignoreUndocumented: true,\n validateResponses: false,\n ...options?.validatorOptions,\n apiSpec: spec as any,\n }),\n );\n\n /**\n * Revert `req.baseUrl` and `req.originalUrl` changes. This ensures that any further usage\n * of these variables will be unchanged.\n */\n router.use((req: Request, _, next) => {\n const customRequest = req as PropertyOverrideRequest;\n customRequest.baseUrl = customRequest[baseUrlSymbol];\n customRequest.originalUrl = customRequest[originalUrlSymbol];\n delete customRequest[baseUrlSymbol];\n delete customRequest[originalUrlSymbol];\n next();\n });\n\n // Any errors from the middleware get through here.\n router.use(validatorErrorTransformer());\n\n router.get(OPENAPI_SPEC_ROUTE, async (req, res) => {\n const mergeOutput = merge([\n {\n oas: spec as any,\n pathModification: {\n /**\n * Get the route that this OpenAPI spec is hosted on. The other\n * approach of using the discovery API increases the router constructor\n * significantly and since we're just looking for path and not full URL,\n * this works.\n *\n * If we wanted to add a list of servers, there may be a case for adding\n * discovery API to get an exhaustive list of upstream servers, but that's\n * also not currently supported.\n */\n prepend: req.originalUrl.replace(OPENAPI_SPEC_ROUTE, ''),\n },\n },\n ]);\n if (isErrorResult(mergeOutput)) {\n throw new InputError('Invalid spec defined');\n }\n res.json(mergeOutput.output);\n });\n\n return router as ApiRouter<typeof spec>;\n}\n","/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Express } from 'express';\nimport { Server } from 'http';\n\n/**\n * !!! THIS CURRENTLY ONLY SUPPORTS SUPERTEST !!!\n * Running against supertest, we need some way to hit the optic proxy. This ensures that\n * that happens at runtime when in the context of a `yarn optic capture` command.\n * @param app - Express router that would be passed to supertest's `request`.\n * @returns A wrapper around the express router (or the router untouched) that still works with supertest.\n * @public\n */\nexport const wrapInOpenApiTestServer = (app: Express): Server | Express => {\n if (process.env.OPTIC_PROXY) {\n const server = app.listen(+process.env.PORT!);\n return {\n ...server,\n address: () => new URL(process.env.OPTIC_PROXY!),\n } as any;\n }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EAAA;AAC9B,MAAM,MAAA,IAAIL,kBAAW,sBAAsB,CAAA,CAAA;AAAA,KAC7C;AACA,IAAI,GAAA,CAAA,IAAA,CAAK,YAAY,MAAM,CAAA,CAAA;AAAA,GAC5B,CAAA,CAAA;AAED,EAAO,OAAA,MAAA,CAAA;AACT;;AClIa,MAAA,uBAAA,GAA0B,CAAC,GAAmC,KAAA;AACzE,EAAI,IAAA,OAAA,CAAQ,IAAI,WAAa,EAAA;AAC3B,IAAA,MAAM,SAAS,GAAI,CAAA,MAAA,CAAO,CAAC,OAAA,CAAQ,IAAI,IAAK,CAAA,CAAA;AAC5C,IAAO,OAAA;AAAA,MACL,GAAG,MAAA;AAAA,MACH,SAAS,MAAM,IAAI,GAAI,CAAA,OAAA,CAAQ,IAAI,WAAY,CAAA;AAAA,KACjD,CAAA;AAAA,GACF;AACA,EAAO,OAAA,GAAA,CAAA;AACT;;;;;;;"}
1
+ {"version":3,"file":"index.cjs.js","sources":["../src/constants.ts","../src/stub.ts","../src/testUtils.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * The route that all OpenAPI specs should be served from.\n * @public\n */\nexport const OPENAPI_SPEC_ROUTE = '/openapi.json';\n","/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport PromiseRouter from 'express-promise-router';\nimport { ApiRouter } from './router';\nimport { RequiredDoc } from './types';\nimport {\n ErrorRequestHandler,\n RequestHandler,\n NextFunction,\n Request,\n Response,\n json,\n} from 'express';\nimport { InputError } from '@backstage/errors';\nimport { middleware as OpenApiValidator } from 'express-openapi-validator';\nimport { OPENAPI_SPEC_ROUTE } from './constants';\nimport { isErrorResult, merge } from 'openapi-merge';\n\ntype PropertyOverrideRequest = Request & {\n [key: symbol]: string;\n};\n\nconst baseUrlSymbol = Symbol();\nconst originalUrlSymbol = Symbol();\n\nfunction validatorErrorTransformer(): ErrorRequestHandler {\n return (error: Error, _: Request, _2: Response, next: NextFunction) => {\n next(new InputError(error.message));\n };\n}\n\nexport function getDefaultRouterMiddleware() {\n return [json()];\n}\n\n/**\n * Given a base url for a plugin, find the given OpenAPI spec for that plugin.\n * @param baseUrl - Plugin base url.\n * @returns OpenAPI spec route for the base url.\n * @public\n */\nexport function getOpenApiSpecRoute(baseUrl: string) {\n return `${baseUrl}${OPENAPI_SPEC_ROUTE}`;\n}\n\n/**\n * Create a new OpenAPI router with some default middleware.\n * @param spec - Your OpenAPI spec imported as a JSON object.\n * @param validatorOptions - `openapi-express-validator` options to override the defaults.\n * @returns A new express router with validation middleware.\n * @public\n */\nexport function createValidatedOpenApiRouter<T extends RequiredDoc>(\n spec: T,\n options?: {\n validatorOptions?: Partial<Parameters<typeof OpenApiValidator>['0']>;\n middleware?: RequestHandler[];\n },\n) {\n const router = PromiseRouter();\n router.use(options?.middleware || getDefaultRouterMiddleware());\n\n /**\n * Middleware to setup the routing for OpenApiValidator. OpenApiValidator expects `req.originalUrl`\n * and `req.baseUrl` to be the full path. We adjust them here to basically be nothing and then\n * revive the old values in the last function in this method. We could instead update `req.path`\n * but that might affect the routing and I'd rather not.\n *\n * TODO: I opened https://github.com/cdimascio/express-openapi-validator/issues/843\n * to track this on the middleware side, but there was a similar ticket, https://github.com/cdimascio/express-openapi-validator/issues/113\n * that has had minimal activity. If that changes, update this to use a new option on their side.\n */\n router.use((req: Request, _, next) => {\n /**\n * Express typings are weird. They don't recognize PropertyOverrideRequest as a valid\n * Request child and try to overload as PathParams. Just cast it here, since we know\n * what we're doing.\n */\n const customRequest = req as PropertyOverrideRequest;\n customRequest[baseUrlSymbol] = customRequest.baseUrl;\n customRequest.baseUrl = '';\n customRequest[originalUrlSymbol] = customRequest.originalUrl;\n customRequest.originalUrl = customRequest.url;\n next();\n });\n\n // TODO: Handle errors by converting from OpenApiValidator errors to known @backstage/errors errors.\n router.use(\n OpenApiValidator({\n validateRequests: {\n coerceTypes: false,\n allowUnknownQueryParameters: false,\n },\n ignoreUndocumented: true,\n validateResponses: false,\n ...options?.validatorOptions,\n apiSpec: spec as any,\n }),\n );\n\n /**\n * Revert `req.baseUrl` and `req.originalUrl` changes. This ensures that any further usage\n * of these variables will be unchanged.\n */\n router.use((req: Request, _, next) => {\n const customRequest = req as PropertyOverrideRequest;\n customRequest.baseUrl = customRequest[baseUrlSymbol];\n customRequest.originalUrl = customRequest[originalUrlSymbol];\n delete customRequest[baseUrlSymbol];\n delete customRequest[originalUrlSymbol];\n next();\n });\n\n // Any errors from the middleware get through here.\n router.use(validatorErrorTransformer());\n\n router.get(OPENAPI_SPEC_ROUTE, async (req, res) => {\n const mergeOutput = merge([\n {\n oas: spec as any,\n pathModification: {\n /**\n * Get the route that this OpenAPI spec is hosted on. The other\n * approach of using the discovery API increases the router constructor\n * significantly and since we're just looking for path and not full URL,\n * this works.\n *\n * If we wanted to add a list of servers, there may be a case for adding\n * discovery API to get an exhaustive list of upstream servers, but that's\n * also not currently supported.\n */\n prepend: req.originalUrl.replace(OPENAPI_SPEC_ROUTE, ''),\n },\n },\n ]);\n if (isErrorResult(mergeOutput)) {\n throw new InputError('Invalid spec defined');\n }\n res.json(mergeOutput.output);\n });\n\n return router as ApiRouter<typeof spec>;\n}\n","/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Express } from 'express';\nimport { Server } from 'http';\n\n/**\n * !!! THIS CURRENTLY ONLY SUPPORTS SUPERTEST !!!\n * Running against supertest, we need some way to hit the optic proxy. This ensures that\n * that happens at runtime when in the context of a `yarn optic capture` command.\n * @param app - Express router that would be passed to supertest's `request`.\n * @returns A wrapper around the express router (or the router untouched) that still works with supertest.\n * @public\n */\nexport const wrapInOpenApiTestServer = (app: Express): Server | Express => {\n if (process.env.OPTIC_PROXY) {\n const server = app.listen(+process.env.PORT!);\n return {\n ...server,\n address: () => new URL(process.env.OPTIC_PROXY!),\n } as any;\n }\n return app;\n};\n"],"names":["InputError","json","PromiseRouter","OpenApiValidator","merge","isErrorResult"],"mappings":";;;;;;;;;;;;;;;;AAoBO,MAAM,kBAAqB,GAAA,eAAA;;ACgBlC,MAAM,gBAAgB,MAAO,EAAA,CAAA;AAC7B,MAAM,oBAAoB,MAAO,EAAA,CAAA;AAEjC,SAAS,yBAAiD,GAAA;AACxD,EAAA,OAAO,CAAC,KAAA,EAAc,CAAY,EAAA,EAAA,EAAc,IAAuB,KAAA;AACrE,IAAA,IAAA,CAAK,IAAIA,iBAAA,CAAW,KAAM,CAAA,OAAO,CAAC,CAAA,CAAA;AAAA,GACpC,CAAA;AACF,CAAA;AAEO,SAAS,0BAA6B,GAAA;AAC3C,EAAO,OAAA,CAACC,cAAM,CAAA,CAAA;AAChB,CAAA;AAQO,SAAS,oBAAoB,OAAiB,EAAA;AACnD,EAAO,OAAA,CAAA,EAAG,OAAO,CAAA,EAAG,kBAAkB,CA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@@ -390,152 +390,85 @@ interface DocRequestMatcher<Doc extends RequiredDoc, T, Method extends 'all' | '
390
390
  <Path extends MethodAwareDocPath<Doc, PathTemplate<Extract<keyof Doc['paths'], string>>, Method>>(path: Path, ...handlers: Array<DocRequestHandlerParams<Doc, TemplateToDocPath<Doc, Path>, Method>>): T;
391
391
  }
392
392
 
393
- type index_d_RequiredDoc = RequiredDoc;
394
- type index_d_PathDoc = PathDoc;
395
- type index_d_ValueOf<T> = ValueOf<T>;
396
- type index_d_DocPath<Doc extends PathDoc> = DocPath<Doc>;
397
- type index_d_PathTemplate<Path extends string> = PathTemplate<Path>;
398
- type index_d_TemplateToDocPath<Doc extends PathDoc, Path extends DocPathTemplate<Doc>> = TemplateToDocPath<Doc, Path>;
399
- type index_d_DocPathTemplate<Doc extends PathDoc> = DocPathTemplate<Doc>;
400
- type index_d_DocPathMethod<Doc extends Pick<RequiredDoc, 'paths'>, Path extends DocPath<Doc>> = DocPathMethod<Doc, Path>;
401
- type index_d_DocPathTemplateMethod<Doc extends Pick<RequiredDoc, 'paths'>, Path extends DocPathTemplate<Doc>> = DocPathTemplateMethod<Doc, Path>;
402
- type index_d_MethodAwareDocPath<Doc extends PathDoc, Path extends DocPathTemplate<Doc>, Method extends DocPathTemplateMethod<Doc, Path>> = MethodAwareDocPath<Doc, Path, Method>;
403
- type index_d_DocOperation<Doc extends RequiredDoc, Path extends DocPath<Doc>, Method extends keyof Doc['paths'][Path]> = DocOperation<Doc, Path, Method>;
404
- type index_d_ComponentTypes<Doc extends RequiredDoc> = ComponentTypes<Doc>;
405
393
  type index_d_ComponentRef<Doc extends RequiredDoc, Type extends ComponentTypes<Doc>, Ref extends ImmutableReferenceObject> = ComponentRef<Doc, Type, Ref>;
406
- type index_d_SchemaRef<Doc extends RequiredDoc, Schema> = SchemaRef<Doc, Schema>;
407
- type index_d_ObjectWithContentSchema<Doc extends RequiredDoc, Object extends {
408
- content?: ImmutableContentObject;
409
- }> = ObjectWithContentSchema<Doc, Object>;
410
- type index_d_UnionToIntersection<U> = UnionToIntersection<U>;
411
- type index_d_LastOf<T> = LastOf<T>;
412
- type index_d_Push<T extends any[], V> = Push<T, V>;
413
- type index_d_TuplifyUnion<T, L = LastOf<T>, N = [T] extends [never] ? true : false> = TuplifyUnion<T, L, N>;
394
+ type index_d_ComponentTypes<Doc extends RequiredDoc> = ComponentTypes<Doc>;
414
395
  type index_d_ConvertAll<T extends ReadonlyArray<unknown>> = ConvertAll<T>;
415
- type index_d_UnknownIfNever<P> = UnknownIfNever<P>;
416
- type index_d_ToTypeSafe<T> = ToTypeSafe<T>;
396
+ type index_d_CookieObject = CookieObject;
397
+ type index_d_CookieSchema<Doc extends RequiredDoc, Path extends DocPath<Doc>, Method extends DocPathMethod<Doc, Path>> = CookieSchema<Doc, Path, Method>;
417
398
  type index_d_DiscriminateUnion<T, K extends keyof T, V extends T[K]> = DiscriminateUnion<T, K, V>;
418
- type index_d_MapDiscriminatedUnion<T extends Record<K, string>, K extends keyof T> = MapDiscriminatedUnion<T, K>;
419
- type index_d_PickOptionalKeys<T extends {
420
- [key: string]: any;
421
- }> = PickOptionalKeys<T>;
422
- type index_d_PickRequiredKeys<T extends {
423
- [key: string]: any;
424
- }> = PickRequiredKeys<T>;
425
- type index_d_OptionalMap<T extends {
426
- [key: string]: any;
427
- }> = OptionalMap<T>;
428
- type index_d_RequiredMap<T extends {
429
- [key: string]: any;
430
- }> = RequiredMap<T>;
431
- type index_d_FullMap<T extends {
432
- [key: string]: any;
433
- }> = FullMap<T>;
434
- type index_d_Filter<T, U> = Filter<T, U>;
399
+ type index_d_DocOperation<Doc extends RequiredDoc, Path extends DocPath<Doc>, Method extends keyof Doc['paths'][Path]> = DocOperation<Doc, Path, Method>;
400
+ type index_d_DocParameter<Doc extends RequiredDoc, Path extends DocPath<Doc>, Method extends DocPathMethod<Doc, Path>, Parameter extends keyof DocOperation<Doc, Path, Method>['parameters']> = DocParameter<Doc, Path, Method, Parameter>;
401
+ type index_d_DocParameters<Doc extends RequiredDoc, Path extends Extract<keyof Doc['paths'], string>, Method extends keyof Doc['paths'][Path]> = DocParameters<Doc, Path, Method>;
402
+ type index_d_DocPath<Doc extends PathDoc> = DocPath<Doc>;
403
+ type index_d_DocPathMethod<Doc extends Pick<RequiredDoc, 'paths'>, Path extends DocPath<Doc>> = DocPathMethod<Doc, Path>;
404
+ type index_d_DocPathTemplate<Doc extends PathDoc> = DocPathTemplate<Doc>;
405
+ type index_d_DocPathTemplateMethod<Doc extends Pick<RequiredDoc, 'paths'>, Path extends DocPathTemplate<Doc>> = DocPathTemplateMethod<Doc, Path>;
435
406
  type index_d_DocRequestHandler<Doc extends RequiredDoc, Path extends DocPath<Doc>, Method extends DocPathMethod<Doc, Path>> = DocRequestHandler<Doc, Path, Method>;
436
407
  type index_d_DocRequestHandlerParams<Doc extends RequiredDoc, Path extends DocPath<Doc>, Method extends DocPathMethod<Doc, Path>> = DocRequestHandlerParams<Doc, Path, Method>;
437
408
  type index_d_DocRequestMatcher<Doc extends RequiredDoc, T, Method extends 'all' | 'get' | 'post' | 'put' | 'delete' | 'patch' | 'options' | 'head'> = DocRequestMatcher<Doc, T, Method>;
409
+ type index_d_Filter<T, U> = Filter<T, U>;
410
+ type index_d_FromNumberStringToNumber<NumberString extends string | number | symbol> = FromNumberStringToNumber<NumberString>;
411
+ type index_d_FullMap<T extends {
412
+ [key: string]: any;
413
+ }> = FullMap<T>;
414
+ type index_d_HeaderObject = HeaderObject;
415
+ type index_d_HeaderSchema<Doc extends RequiredDoc, Path extends DocPath<Doc>, Method extends DocPathMethod<Doc, Path>> = HeaderSchema<Doc, Path, Method>;
438
416
  type index_d_Immutable<T> = Immutable<T>;
417
+ type index_d_ImmutableContentObject = ImmutableContentObject;
418
+ type index_d_ImmutableCookieObject = ImmutableCookieObject;
419
+ type index_d_ImmutableHeaderObject = ImmutableHeaderObject;
439
420
  type index_d_ImmutableObject<T> = ImmutableObject<T>;
440
- type index_d_ImmutableReferenceObject = ImmutableReferenceObject;
441
421
  type index_d_ImmutableOpenAPIObject = ImmutableOpenAPIObject;
442
- type index_d_ImmutableContentObject = ImmutableContentObject;
443
- type index_d_ImmutableRequestBodyObject = ImmutableRequestBodyObject;
444
- type index_d_ImmutableResponseObject = ImmutableResponseObject;
445
422
  type index_d_ImmutableParameterObject = ImmutableParameterObject;
446
- type index_d_HeaderObject = HeaderObject;
447
- type index_d_ImmutableHeaderObject = ImmutableHeaderObject;
448
- type index_d_CookieObject = CookieObject;
449
- type index_d_ImmutableCookieObject = ImmutableCookieObject;
450
- type index_d_QueryObject = QueryObject;
451
- type index_d_ImmutableQueryObject = ImmutableQueryObject;
452
- type index_d_PathObject = PathObject;
453
423
  type index_d_ImmutablePathObject = ImmutablePathObject;
424
+ type index_d_ImmutableQueryObject = ImmutableQueryObject;
425
+ type index_d_ImmutableReferenceObject = ImmutableReferenceObject;
426
+ type index_d_ImmutableRequestBodyObject = ImmutableRequestBodyObject;
427
+ type index_d_ImmutableResponseObject = ImmutableResponseObject;
454
428
  type index_d_ImmutableSchemaObject = ImmutableSchemaObject;
455
- type index_d_DocParameter<Doc extends RequiredDoc, Path extends DocPath<Doc>, Method extends DocPathMethod<Doc, Path>, Parameter extends keyof DocOperation<Doc, Path, Method>['parameters']> = DocParameter<Doc, Path, Method, Parameter>;
456
- type index_d_FromNumberStringToNumber<NumberString extends string | number | symbol> = FromNumberStringToNumber<NumberString>;
457
- type index_d_DocParameters<Doc extends RequiredDoc, Path extends Extract<keyof Doc['paths'], string>, Method extends keyof Doc['paths'][Path]> = DocParameters<Doc, Path, Method>;
458
- type index_d_ParameterSchema<Doc extends RequiredDoc, Schema extends ImmutableParameterObject['schema']> = ParameterSchema<Doc, Schema>;
429
+ type index_d_LastOf<T> = LastOf<T>;
430
+ type index_d_MapDiscriminatedUnion<T extends Record<K, string>, K extends keyof T> = MapDiscriminatedUnion<T, K>;
459
431
  type index_d_MapToSchema<Doc extends RequiredDoc, T extends Record<string, ImmutableParameterObject>> = MapToSchema<Doc, T>;
432
+ type index_d_MethodAwareDocPath<Doc extends PathDoc, Path extends DocPathTemplate<Doc>, Method extends DocPathTemplateMethod<Doc, Path>> = MethodAwareDocPath<Doc, Path, Method>;
433
+ type index_d_ObjectWithContentSchema<Doc extends RequiredDoc, Object extends {
434
+ content?: ImmutableContentObject;
435
+ }> = ObjectWithContentSchema<Doc, Object>;
436
+ type index_d_OptionalMap<T extends {
437
+ [key: string]: any;
438
+ }> = OptionalMap<T>;
439
+ type index_d_ParameterSchema<Doc extends RequiredDoc, Schema extends ImmutableParameterObject['schema']> = ParameterSchema<Doc, Schema>;
460
440
  type index_d_ParametersSchema<Doc extends RequiredDoc, Path extends Extract<keyof Doc['paths'], string>, Method extends keyof Doc['paths'][Path], FilterType extends ImmutableParameterObject> = ParametersSchema<Doc, Path, Method, FilterType>;
461
- type index_d_HeaderSchema<Doc extends RequiredDoc, Path extends DocPath<Doc>, Method extends DocPathMethod<Doc, Path>> = HeaderSchema<Doc, Path, Method>;
462
- type index_d_CookieSchema<Doc extends RequiredDoc, Path extends DocPath<Doc>, Method extends DocPathMethod<Doc, Path>> = CookieSchema<Doc, Path, Method>;
441
+ type index_d_PathDoc = PathDoc;
442
+ type index_d_PathObject = PathObject;
463
443
  type index_d_PathSchema<Doc extends RequiredDoc, Path extends DocPath<Doc>, Method extends DocPathMethod<Doc, Path>> = PathSchema<Doc, Path, Method>;
444
+ type index_d_PathTemplate<Path extends string> = PathTemplate<Path>;
445
+ type index_d_PickOptionalKeys<T extends {
446
+ [key: string]: any;
447
+ }> = PickOptionalKeys<T>;
448
+ type index_d_PickRequiredKeys<T extends {
449
+ [key: string]: any;
450
+ }> = PickRequiredKeys<T>;
451
+ type index_d_Push<T extends any[], V> = Push<T, V>;
452
+ type index_d_QueryObject = QueryObject;
464
453
  type index_d_QuerySchema<Doc extends RequiredDoc, Path extends DocPath<Doc>, Method extends DocPathMethod<Doc, Path>> = QuerySchema<Doc, Path, Method>;
465
454
  type index_d_RequestBody<Doc extends RequiredDoc, Path extends Extract<keyof Doc['paths'], string>, Method extends keyof Doc['paths'][Path]> = RequestBody<Doc, Path, Method>;
466
455
  type index_d_RequestBodySchema<Doc extends RequiredDoc, Path extends DocPath<Doc>, Method extends DocPathMethod<Doc, Path>> = RequestBodySchema<Doc, Path, Method>;
467
456
  type index_d_RequestBodyToJsonSchema<Doc extends RequiredDoc, Path extends DocPath<Doc>, Method extends DocPathMethod<Doc, Path>> = RequestBodyToJsonSchema<Doc, Path, Method>;
468
- type index_d_ResponseSchemas<Doc extends RequiredDoc, Path extends DocPath<Doc>, Method extends DocPathMethod<Doc, Path>> = ResponseSchemas<Doc, Path, Method>;
457
+ type index_d_RequiredDoc = RequiredDoc;
458
+ type index_d_RequiredMap<T extends {
459
+ [key: string]: any;
460
+ }> = RequiredMap<T>;
469
461
  type index_d_ResponseBodyToJsonSchema<Doc extends RequiredDoc, Path extends DocPath<Doc>, Method extends DocPathMethod<Doc, Path>> = ResponseBodyToJsonSchema<Doc, Path, Method>;
462
+ type index_d_ResponseSchemas<Doc extends RequiredDoc, Path extends DocPath<Doc>, Method extends DocPathMethod<Doc, Path>> = ResponseSchemas<Doc, Path, Method>;
463
+ type index_d_SchemaRef<Doc extends RequiredDoc, Schema> = SchemaRef<Doc, Schema>;
464
+ type index_d_TemplateToDocPath<Doc extends PathDoc, Path extends DocPathTemplate<Doc>> = TemplateToDocPath<Doc, Path>;
465
+ type index_d_ToTypeSafe<T> = ToTypeSafe<T>;
466
+ type index_d_TuplifyUnion<T, L = LastOf<T>, N = [T] extends [never] ? true : false> = TuplifyUnion<T, L, N>;
467
+ type index_d_UnionToIntersection<U> = UnionToIntersection<U>;
468
+ type index_d_UnknownIfNever<P> = UnknownIfNever<P>;
469
+ type index_d_ValueOf<T> = ValueOf<T>;
470
470
  declare namespace index_d {
471
- export {
472
- index_d_RequiredDoc as RequiredDoc,
473
- index_d_PathDoc as PathDoc,
474
- index_d_ValueOf as ValueOf,
475
- index_d_DocPath as DocPath,
476
- index_d_PathTemplate as PathTemplate,
477
- index_d_TemplateToDocPath as TemplateToDocPath,
478
- index_d_DocPathTemplate as DocPathTemplate,
479
- index_d_DocPathMethod as DocPathMethod,
480
- index_d_DocPathTemplateMethod as DocPathTemplateMethod,
481
- index_d_MethodAwareDocPath as MethodAwareDocPath,
482
- index_d_DocOperation as DocOperation,
483
- index_d_ComponentTypes as ComponentTypes,
484
- index_d_ComponentRef as ComponentRef,
485
- index_d_SchemaRef as SchemaRef,
486
- index_d_ObjectWithContentSchema as ObjectWithContentSchema,
487
- index_d_UnionToIntersection as UnionToIntersection,
488
- index_d_LastOf as LastOf,
489
- index_d_Push as Push,
490
- index_d_TuplifyUnion as TuplifyUnion,
491
- index_d_ConvertAll as ConvertAll,
492
- index_d_UnknownIfNever as UnknownIfNever,
493
- index_d_ToTypeSafe as ToTypeSafe,
494
- index_d_DiscriminateUnion as DiscriminateUnion,
495
- index_d_MapDiscriminatedUnion as MapDiscriminatedUnion,
496
- index_d_PickOptionalKeys as PickOptionalKeys,
497
- index_d_PickRequiredKeys as PickRequiredKeys,
498
- index_d_OptionalMap as OptionalMap,
499
- index_d_RequiredMap as RequiredMap,
500
- index_d_FullMap as FullMap,
501
- index_d_Filter as Filter,
502
- index_d_DocRequestHandler as DocRequestHandler,
503
- index_d_DocRequestHandlerParams as DocRequestHandlerParams,
504
- index_d_DocRequestMatcher as DocRequestMatcher,
505
- index_d_Immutable as Immutable,
506
- index_d_ImmutableObject as ImmutableObject,
507
- index_d_ImmutableReferenceObject as ImmutableReferenceObject,
508
- index_d_ImmutableOpenAPIObject as ImmutableOpenAPIObject,
509
- index_d_ImmutableContentObject as ImmutableContentObject,
510
- index_d_ImmutableRequestBodyObject as ImmutableRequestBodyObject,
511
- index_d_ImmutableResponseObject as ImmutableResponseObject,
512
- index_d_ImmutableParameterObject as ImmutableParameterObject,
513
- index_d_HeaderObject as HeaderObject,
514
- index_d_ImmutableHeaderObject as ImmutableHeaderObject,
515
- index_d_CookieObject as CookieObject,
516
- index_d_ImmutableCookieObject as ImmutableCookieObject,
517
- index_d_QueryObject as QueryObject,
518
- index_d_ImmutableQueryObject as ImmutableQueryObject,
519
- index_d_PathObject as PathObject,
520
- index_d_ImmutablePathObject as ImmutablePathObject,
521
- index_d_ImmutableSchemaObject as ImmutableSchemaObject,
522
- index_d_DocParameter as DocParameter,
523
- index_d_FromNumberStringToNumber as FromNumberStringToNumber,
524
- index_d_DocParameters as DocParameters,
525
- index_d_ParameterSchema as ParameterSchema,
526
- index_d_MapToSchema as MapToSchema,
527
- index_d_ParametersSchema as ParametersSchema,
528
- index_d_HeaderSchema as HeaderSchema,
529
- index_d_CookieSchema as CookieSchema,
530
- index_d_PathSchema as PathSchema,
531
- index_d_QuerySchema as QuerySchema,
532
- index_d_RequestBody as RequestBody,
533
- index_d_RequestBodySchema as RequestBodySchema,
534
- index_d_RequestBodyToJsonSchema as RequestBodyToJsonSchema,
535
- Response$1 as Response,
536
- index_d_ResponseSchemas as ResponseSchemas,
537
- index_d_ResponseBodyToJsonSchema as ResponseBodyToJsonSchema,
538
- };
471
+ export type { index_d_ComponentRef as ComponentRef, index_d_ComponentTypes as ComponentTypes, index_d_ConvertAll as ConvertAll, index_d_CookieObject as CookieObject, index_d_CookieSchema as CookieSchema, index_d_DiscriminateUnion as DiscriminateUnion, index_d_DocOperation as DocOperation, index_d_DocParameter as DocParameter, index_d_DocParameters as DocParameters, index_d_DocPath as DocPath, index_d_DocPathMethod as DocPathMethod, index_d_DocPathTemplate as DocPathTemplate, index_d_DocPathTemplateMethod as DocPathTemplateMethod, index_d_DocRequestHandler as DocRequestHandler, index_d_DocRequestHandlerParams as DocRequestHandlerParams, index_d_DocRequestMatcher as DocRequestMatcher, index_d_Filter as Filter, index_d_FromNumberStringToNumber as FromNumberStringToNumber, index_d_FullMap as FullMap, index_d_HeaderObject as HeaderObject, index_d_HeaderSchema as HeaderSchema, index_d_Immutable as Immutable, index_d_ImmutableContentObject as ImmutableContentObject, index_d_ImmutableCookieObject as ImmutableCookieObject, index_d_ImmutableHeaderObject as ImmutableHeaderObject, index_d_ImmutableObject as ImmutableObject, index_d_ImmutableOpenAPIObject as ImmutableOpenAPIObject, index_d_ImmutableParameterObject as ImmutableParameterObject, index_d_ImmutablePathObject as ImmutablePathObject, index_d_ImmutableQueryObject as ImmutableQueryObject, index_d_ImmutableReferenceObject as ImmutableReferenceObject, index_d_ImmutableRequestBodyObject as ImmutableRequestBodyObject, index_d_ImmutableResponseObject as ImmutableResponseObject, index_d_ImmutableSchemaObject as ImmutableSchemaObject, index_d_LastOf as LastOf, index_d_MapDiscriminatedUnion as MapDiscriminatedUnion, index_d_MapToSchema as MapToSchema, index_d_MethodAwareDocPath as MethodAwareDocPath, index_d_ObjectWithContentSchema as ObjectWithContentSchema, index_d_OptionalMap as OptionalMap, index_d_ParameterSchema as ParameterSchema, index_d_ParametersSchema as ParametersSchema, index_d_PathDoc as PathDoc, index_d_PathObject as PathObject, index_d_PathSchema as PathSchema, index_d_PathTemplate as PathTemplate, index_d_PickOptionalKeys as PickOptionalKeys, index_d_PickRequiredKeys as PickRequiredKeys, index_d_Push as Push, index_d_QueryObject as QueryObject, index_d_QuerySchema as QuerySchema, index_d_RequestBody as RequestBody, index_d_RequestBodySchema as RequestBodySchema, index_d_RequestBodyToJsonSchema as RequestBodyToJsonSchema, index_d_RequiredDoc as RequiredDoc, index_d_RequiredMap as RequiredMap, Response$1 as Response, index_d_ResponseBodyToJsonSchema as ResponseBodyToJsonSchema, index_d_ResponseSchemas as ResponseSchemas, index_d_SchemaRef as SchemaRef, index_d_TemplateToDocPath as TemplateToDocPath, index_d_ToTypeSafe as ToTypeSafe, index_d_TuplifyUnion as TuplifyUnion, index_d_UnionToIntersection as UnionToIntersection, index_d_UnknownIfNever as UnknownIfNever, index_d_ValueOf as ValueOf };
539
472
  }
540
473
 
541
474
  /**
@@ -607,4 +540,4 @@ declare function createValidatedOpenApiRouter<T extends RequiredDoc>(spec: T, op
607
540
  */
608
541
  declare const wrapInOpenApiTestServer: (app: Express) => Server | Express;
609
542
 
610
- export { ApiRouter, CookieParameters, HeaderParameters, PathParameters, QueryParameters, Request, Response, createValidatedOpenApiRouter, getOpenApiSpecRoute, index_d as internal, wrapInOpenApiTestServer };
543
+ export { type ApiRouter, type CookieParameters, type HeaderParameters, type PathParameters, type QueryParameters, type Request, type Response, createValidatedOpenApiRouter, getOpenApiSpecRoute, index_d as internal, wrapInOpenApiTestServer };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@backstage/backend-openapi-utils",
3
3
  "description": "OpenAPI typescript support.",
4
- "version": "0.1.7",
4
+ "version": "0.1.8",
5
5
  "main": "dist/index.cjs.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "license": "Apache-2.0",
@@ -30,14 +30,14 @@
30
30
  "postpack": "backstage-cli package postpack"
31
31
  },
32
32
  "devDependencies": {
33
- "@backstage/cli": "^0.26.0",
33
+ "@backstage/cli": "^0.26.1",
34
34
  "supertest": "^6.1.3"
35
35
  },
36
36
  "files": [
37
37
  "dist"
38
38
  ],
39
39
  "dependencies": {
40
- "@backstage/backend-plugin-api": "^0.6.14",
40
+ "@backstage/backend-plugin-api": "^0.6.15",
41
41
  "@backstage/errors": "^1.2.4",
42
42
  "@types/express": "^4.17.6",
43
43
  "@types/express-serve-static-core": "^4.17.5",