8.1.17 • Published 11 months ago

ut-api v8.1.17

Weekly downloads
40
License
Apache-2.0
Repository
github
Last release
11 months ago

ut-api

API generation tools for hapi

API

Exposes a single initialization method:

async init(config, errors) - initializes the module

  • config - configuration object with the following properties:
    • ui - boolean, activates generation of UI for the API
    • document - define custom endpoints based on Swagger 2.0 or OpenAPI 3.0 document. Possible values are:
      • function - the function is called and it must return parsed API document
      • string - the string is parsed to create the API document
      • object - must be valid API document
      • anything else will generate empty API document
  • result - the function returns object with the following properties:
    • uiRoutes - object containing hapi routes that handle the API ui
    • rpcRoutes - function, used to define RPC routes based on JOI validations
    • restRoutes - function, used to define attach handler for REST routes, based on the passed config.document

The functions in the result have the following signatures:

  • function rpcRoutes(definitions)
    • definitions - array of objects with the following properties, used to describe each method:
      • tags - method tags
      • app - custom method properties
      • timeout - handler default timeout
      • method - method name
      • description - short method description
      • notes - long method description
      • params - joi validation of method params
      • result - joi validation of method result
      • validate - hapi route validate options
      • handler - hapi route handler
    • result - object containing hapi routes that handle the generated RPC routes
  • function restRoutesApi({namespace, fn, object})
    • namespace - namespace of the handler function
    • fn - handler function
    • object - handler function binding for this
    • result - object containing hapi routes that handle the generated REST routes
8.1.17

11 months ago

8.1.16

11 months ago

8.1.11

2 years ago

8.1.10

2 years ago

8.1.13

2 years ago

8.1.12

2 years ago

8.1.15

2 years ago

8.1.14

2 years ago

8.1.9

2 years ago

8.1.8

3 years ago

8.1.7

3 years ago

8.1.6

3 years ago

8.1.4

3 years ago

8.1.5

3 years ago

8.1.0

3 years ago

8.1.2

3 years ago

8.1.1

3 years ago

8.1.3

3 years ago

7.21.2

3 years ago

7.21.1

3 years ago

7.21.0

3 years ago

7.19.3

3 years ago

7.19.4

3 years ago

7.19.1

3 years ago

7.19.2

3 years ago

7.20.0

3 years ago

7.18.0

4 years ago

7.19.0

4 years ago

7.17.0

4 years ago

7.16.0

4 years ago

7.16.1

4 years ago

7.15.1

4 years ago

7.15.0

4 years ago

7.14.2

4 years ago

7.14.1

4 years ago

7.14.0

4 years ago

7.13.1

4 years ago

7.13.2

4 years ago

7.13.0

4 years ago

7.12.0

4 years ago

7.11.4

5 years ago

7.11.3

5 years ago

7.11.2

5 years ago

7.11.1

5 years ago

7.11.0

5 years ago

7.10.1

5 years ago

7.10.0

5 years ago

7.9.2

5 years ago

7.9.1

5 years ago

7.8.0

5 years ago

7.9.0

5 years ago

7.8.1

5 years ago

7.7.0

5 years ago

7.6.0

5 years ago

7.5.0

5 years ago

7.4.7

5 years ago

7.4.6

6 years ago

7.4.5

6 years ago

7.4.4

6 years ago

7.4.3

6 years ago

7.4.2

6 years ago

7.4.1

6 years ago

7.4.0

6 years ago

7.3.0

6 years ago

7.2.0

6 years ago

7.1.1

6 years ago

7.1.0

6 years ago

7.0.4

6 years ago

7.0.3

6 years ago

7.0.2

6 years ago

7.0.1

6 years ago