6.2.1 • Published 5 months ago

@axway/requester v6.2.1

Weekly downloads
396
License
SEE LICENCE IN LI...
Repository
-
Last release
5 months ago

axway-requester

Module for http communication with third-party APIs. It is currently used within api-builder-plugin-fn-swagger.

js-standard-style

Public API

Currently the module expose just a single function as public API

  makeRequest: (options, callback) => {}

The following mandatory parameters should be in options object so the function to work correctly:

  • requestData - The business data that goes with the request. It is defined in the 'key: value' form. If two parameters exists with the same name they must be prefixed with the section (as descibed in the Swagger 2.0 standard) in which they should go. For example we could have:
  requestData = {
    path.name: 'value',
    query.name: 'value'
  }
  • endpointMetadata - The metadata that describes the endpoint in similar manner to swagger standard. It is used to construct the request and is automatically build out of swagger with additional tool.
  • runtimeConfig - The static configuration of the service that is used to define authentication mechanisms and other options that tune the working of the module.

Configuration parameters

Authentication

'x-vendor-openapi-authtype' - this parameter must be specified if the client app needs to configure authentication mechanisms with the service it consumes. Possible values are - basic, apiKey or oauth2

Each of these values requires additional parameters as described in the table bellow:

Config paramsDescription
'x-vendor-openapi-username'basic authentication type requires to provide username
'x-vendor-openapi-password'basic authentication type requires to provide password
'x-vendor-openapi-key'apiKey authentication type requires to provide key
'x-vendor-openapi-token'oauth2 authentication type requires to provide access token

Endpoint URI

'x-vendor-openapi-uri' - if this parameter is set the module takes it into account to override the predefined endpoint url. One could specify either the port, host, protocol, or base path as descibed in the table bellow:

Config paramsDescription
'x-vendor-openapi-uri.protocol'application protocol i.e. transfer protocol such as HTTP/HTTPs
'x-vendor-openapi-uri.host'server name
'x-vendor-openapi-uri.port'specifies the port on which the host system listens for requests. This parameter is optional. The default one will be set, depends on the protocol.
'x-vendor-openapi-uri.basePath'basePath is the path to the API/Api version etc.

How to use?

Use the following command to install the dependencies and run the test suite:

npm run all

The module can be used in plain javascript program as long as one would know how to generate endpointMetadata. The rest of the properties are straightforward since they are plain object litterals with key-value pairs. See test/example folder for example how to connect to Giphy service.

Author

Axway R&D support@axway.com https://axway.com

License

This code is proprietary, closed source software licensed to you by Axway. All Rights Reserved. You may not modify Axway’s code without express written permission of Axway. You are licensed to use and distribute your services developed with the use of this software and dependencies, including distributing reasonable and appropriate portions of the Axway code and dependencies. Except as set forth above, this code MUST not be copied or otherwise redistributed without express written permission of Axway. This module is licensed as part of the Axway Platform and governed under the terms of the Axway license agreement (General Conditions) located here: https://support.axway.com/en/auth/general-conditions. Your right to use this software is strictly limited to the term (if any) of the license or subscription originally granted to you.

5.1.1

5 months ago

5.1.0

5 months ago

6.2.1

5 months ago

6.2.0

6 months ago

6.1.0

6 months ago

5.0.5

2 years ago

6.0.1

2 years ago

6.0.0

2 years ago

5.0.4

2 years ago

5.0.3

2 years ago

5.0.2

2 years ago

5.0.1

2 years ago

5.0.0

2 years ago

4.0.7

2 years ago

4.0.6

3 years ago

4.0.5

4 years ago

4.0.4

4 years ago

4.0.3

4 years ago

4.0.2

4 years ago

4.0.1

5 years ago

4.0.0

5 years ago

3.2.4

5 years ago

3.2.3

5 years ago

3.2.2

5 years ago

3.2.1

5 years ago

3.2.0

5 years ago

3.1.1

5 years ago

3.1.0

5 years ago

3.0.0

5 years ago

2.1.2

5 years ago

2.1.1

5 years ago

2.1.0

5 years ago

2.0.0

5 years ago

1.2.1

5 years ago

1.2.0

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.1-1

6 years ago