8.1.15 • Published 12 months ago

ut-api v8.1.15

Weekly downloads
40
License
Apache-2.0
Repository
github
Last release
12 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.11

1 year ago

8.1.10

1 year ago

8.1.13

1 year ago

8.1.12

1 year ago

8.1.15

12 months ago

8.1.14

1 year ago

8.1.9

1 year ago

8.1.8

1 year ago

8.1.7

1 year ago

8.1.6

2 years ago

8.1.4

2 years ago

8.1.5

2 years ago

8.1.0

2 years ago

8.1.2

2 years ago

8.1.1

2 years ago

8.1.3

2 years ago

7.21.2

2 years ago

7.21.1

2 years ago

7.21.0

2 years ago

7.19.3

2 years ago

7.19.4

2 years ago

7.19.1

2 years ago

7.19.2

2 years ago

7.20.0

2 years ago

7.18.0

2 years ago

7.19.0

2 years ago

7.17.0

2 years ago

7.16.0

3 years ago

7.16.1

2 years ago

7.15.1

3 years ago

7.15.0

3 years ago

7.14.2

3 years ago

7.14.1

3 years ago

7.14.0

3 years ago

7.13.1

3 years ago

7.13.2

3 years ago

7.13.0

3 years ago

7.12.0

3 years ago

7.11.4

3 years ago

7.11.3

3 years ago

7.11.2

4 years ago

7.11.1

4 years ago

7.11.0

4 years ago

7.10.1

4 years ago

7.10.0

4 years ago

7.9.2

4 years ago

7.9.1

4 years ago

7.8.0

4 years ago

7.9.0

4 years ago

7.8.1

4 years ago

7.7.0

4 years ago

7.6.0

4 years ago

7.5.0

4 years ago

7.4.7

4 years ago

7.4.6

4 years ago

7.4.5

4 years ago

7.4.4

4 years ago

7.4.3

4 years ago

7.4.2

4 years ago

7.4.1

4 years ago

7.4.0

4 years ago

7.3.0

4 years ago

7.2.0

4 years ago

7.1.1

4 years ago

7.1.0

4 years ago

7.0.4

5 years ago

7.0.3

5 years ago

7.0.2

5 years ago

7.0.1

5 years ago