From 988a79cc7914bdae6a9435a924af783eabd94bc3 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Wed, 11 Dec 2024 15:48:31 +0000 Subject: [PATCH] chore(release): 3.1.1 [skip ci] ## [3.1.1](https://github.com/matzehecht/koa-oas-router/compare/v3.1.0...v3.1.1) (2024-12-11) ### Bug Fixes * update deps ([245cce6](https://github.com/matzehecht/koa-oas-router/commit/245cce610a72512b9f91c136ffaa844025e8e7ae)) --- CHANGELOG.md | 7 +++++++ docs/classes/KoaOasRouter.html | 6 +++--- docs/interfaces/AddFromSpecificationOpts.html | 14 +++++++------- docs/interfaces/Operation.html | 6 +++--- docs/interfaces/Path.html | 12 ++++++------ docs/interfaces/Paths.html | 2 +- docs/interfaces/Specification.html | 4 ++-- docs/types/mapControllerBy.html | 2 +- 8 files changed, 30 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ff48ea..71d6c9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [3.1.1](https://github.com/matzehecht/koa-oas-router/compare/v3.1.0...v3.1.1) (2024-12-11) + + +### Bug Fixes + +* update deps ([245cce6](https://github.com/matzehecht/koa-oas-router/commit/245cce610a72512b9f91c136ffaa844025e8e7ae)) + ## [3.1.1-beta.1](https://github.com/matzehecht/koa-oas-router/compare/v3.1.0...v3.1.1-beta.1) (2024-12-11) diff --git a/docs/classes/KoaOasRouter.html b/docs/classes/KoaOasRouter.html index f5d22ee..accb0ba 100644 --- a/docs/classes/KoaOasRouter.html +++ b/docs/classes/KoaOasRouter.html @@ -1,13 +1,13 @@ KoaOasRouter | koa-oas-router

Class KoaOasRouter<StateT, CustomT>

A child class of the koa-router. It extends the koa-router by some features that can be used with oas.

KoaOasRouter

-

Type Parameters

  • StateT = any
  • CustomT = {}

Hierarchy

  • Router
    • KoaOasRouter

Constructors

Type Parameters

  • StateT = any
  • CustomT = {}

Hierarchy

  • Router
    • KoaOasRouter

Constructors

Methods

  • Adds the routes from a specification to the router. As implementation it uses the controllers from the opts.controllerBasePath (default = '../controller'). +

Methods

  • Adds the routes from a specification to the router. As implementation it uses the controllers from the opts.controllerBasePath (default = '../controller'). The name of the controller file is the first tag of a operation in pascal case. The name of the function in the controller file is the operationId. The specification will be validated by oas-validator. You can opt this out with opts.validateSpecification. If a implementation is not found this function will add a stub for that. You can opt this out with opts.provideStubs.

    Parameters

    Returns Promise<any>

    KoaOasRouter

    -
+
diff --git a/docs/interfaces/AddFromSpecificationOpts.html b/docs/interfaces/AddFromSpecificationOpts.html index b9e84ad..1a075ba 100644 --- a/docs/interfaces/AddFromSpecificationOpts.html +++ b/docs/interfaces/AddFromSpecificationOpts.html @@ -1,18 +1,18 @@ AddFromSpecificationOpts | koa-oas-router

Interface AddFromSpecificationOpts

Options for adding the routes from a oas specification.

AddFromSpecificationOpts

-
interface AddFromSpecificationOpts {
    controllerBasePath?: string;
    fallbackControllerFunctionToPath?: boolean;
    fallbackControllerToIndex?: boolean;
    mapControllerBy?: mapControllerBy;
    provideStubs?: boolean;
    validateSpecification?: boolean;
}
interface AddFromSpecificationOpts {
    controllerBasePath?: string;
    fallbackControllerFunctionToPath?: boolean;
    fallbackControllerToIndex?: boolean;
    mapControllerBy?: mapControllerBy;
    provideStubs?: boolean;
    validateSpecification?: boolean;
}

Properties

controllerBasePath?: string

The base path in which the controllers can be found.

-
fallbackControllerFunctionToPath?: boolean

Should the controller function name fallback to method + path (method in lower and path in PascalCase)?

+
fallbackControllerFunctionToPath?: boolean

Should the controller function name fallback to method + path (method in lower and path in PascalCase)?

true
 
-
fallbackControllerToIndex?: boolean

Should the index module (index.ts or index.js) be used as fallback?

-
mapControllerBy?: mapControllerBy

Specifies how to map the controller.

-
provideStubs?: boolean

Specifies if stubs should be provided.

-
validateSpecification?: boolean

Specifies if the oas-validator should be used.

-
+
fallbackControllerToIndex?: boolean

Should the index module (index.ts or index.js) be used as fallback?

+
mapControllerBy?: mapControllerBy

Specifies how to map the controller.

+
provideStubs?: boolean

Specifies if stubs should be provided.

+
validateSpecification?: boolean

Specifies if the oas-validator should be used.

+
diff --git a/docs/interfaces/Operation.html b/docs/interfaces/Operation.html index c8723e9..156cd1c 100644 --- a/docs/interfaces/Operation.html +++ b/docs/interfaces/Operation.html @@ -1,7 +1,7 @@ Operation | koa-oas-router

Interface Operation

Representation of one operation.

Operation

-
interface Operation {
    operationId?: string;
    tags?: string[];
    [x: string]: any;
}

Indexable

  • [x: string]: any

Properties

interface Operation {
    operationId?: string;
    tags?: string[];
    [x: string]: any;
}

Indexable

  • [x: string]: any

Properties

Properties

operationId?: string

Specifies the oas operationId.

-
tags?: string[]

Specifies an array of oas tags.

-
+
tags?: string[]

Specifies an array of oas tags.

+
diff --git a/docs/interfaces/Path.html b/docs/interfaces/Path.html index 52d8a78..5f48df1 100644 --- a/docs/interfaces/Path.html +++ b/docs/interfaces/Path.html @@ -1,13 +1,13 @@ Path | koa-oas-router

Interface Path

Representation of the oas path.

Path

-
interface Path {
    delete?: Operation;
    get?: Operation;
    patch?: Operation;
    post?: Operation;
    put?: Operation;
}

Properties

interface Path {
    delete?: Operation;
    get?: Operation;
    patch?: Operation;
    post?: Operation;
    put?: Operation;
}

Properties

delete?: Operation

Specifies the delete operation of the oas path.

-
get?: Operation

Specifies the get operation of the oas path.

-
patch?: Operation

Specifies the patch operation of the oas path.

-
post?: Operation

Specifies the post operation of the oas path.

-
put?: Operation

Specifies the put operation of the oas path.

-
+
get?: Operation

Specifies the get operation of the oas path.

+
patch?: Operation

Specifies the patch operation of the oas path.

+
post?: Operation

Specifies the post operation of the oas path.

+
put?: Operation

Specifies the put operation of the oas path.

+
diff --git a/docs/interfaces/Paths.html b/docs/interfaces/Paths.html index 412d6f2..3fb00ab 100644 --- a/docs/interfaces/Paths.html +++ b/docs/interfaces/Paths.html @@ -1,3 +1,3 @@ Paths | koa-oas-router

Interface Paths

Representation of the oas paths.

Paths

-

Indexable

+

Indexable

diff --git a/docs/interfaces/Specification.html b/docs/interfaces/Specification.html index 24d2b4f..5c8c820 100644 --- a/docs/interfaces/Specification.html +++ b/docs/interfaces/Specification.html @@ -1,5 +1,5 @@ Specification | koa-oas-router

Interface Specification

The oas specification as js object. (Convert it via js-yaml)

Specification

-
interface Specification {
    paths: Paths;
    [x: string]: any;
}

Indexable

  • [x: string]: any

Properties

interface Specification {
    paths: Paths;
    [x: string]: any;
}

Indexable

  • [x: string]: any

Properties

Properties

paths: Paths

Object that hold all the paths.

-
+
diff --git a/docs/types/mapControllerBy.html b/docs/types/mapControllerBy.html index 5596f77..767333b 100644 --- a/docs/types/mapControllerBy.html +++ b/docs/types/mapControllerBy.html @@ -1,4 +1,4 @@ mapControllerBy | koa-oas-router

Type Alias mapControllerBy

mapControllerBy: "TAG" | "PATH"

Possible ways to map the controller

  • "TAG"

    Maps the controller by the operation tag.

  • "PATH"

    Maps the controller by the operation path.

    -
+